G
Guest
I am using SQL to hold session state. My problem is that I have an object
that I want to store in Session State. I can not mark the class it comes from
as Serializable because it is from a DLL that I do not have the code for.
There must be an easy way to do this I just can't figure it out.
This is the code that Serializes the item that I want to place in a Session.
private string Serialize(SessionStateItemCollection items)
{
MemoryStream ms = new MemoryStream();
BinaryWriter writer = new BinaryWriter(ms);
if (items != null)
items.Serialize(writer);
writer.Close();
return Convert.ToBase64String(ms.ToArray());
}
I'd really appreciate anyone who could help.
that I want to store in Session State. I can not mark the class it comes from
as Serializable because it is from a DLL that I do not have the code for.
There must be an easy way to do this I just can't figure it out.
This is the code that Serializes the item that I want to place in a Session.
private string Serialize(SessionStateItemCollection items)
{
MemoryStream ms = new MemoryStream();
BinaryWriter writer = new BinaryWriter(ms);
if (items != null)
items.Serialize(writer);
writer.Close();
return Convert.ToBase64String(ms.ToArray());
}
I'd really appreciate anyone who could help.