Best way to serialize an object to a String

  • Thread starter Thread starter Patrick Sona
  • Start date Start date
P

Patrick Sona

Hi all!

has anyone an idea how to serialize an object to a String without using
XMLSerializer? The problem is, that i have to serialize a Hashtable to a
String and the XMLSerializer doesn't accept any object that inherits
from ICollection. So I have to use the Binary or SoapFormater. But both
accept only a Stream and .net has no StringStream.

Thanx!

Greetings
Pat
 
Patrick said:
Hi all!

has anyone an idea how to serialize an object to a String without using
XMLSerializer? The problem is, that i have to serialize a Hashtable to a
String and the XMLSerializer doesn't accept any object that inherits
from ICollection. So I have to use the Binary or SoapFormater. But both
accept only a Stream and .net has no StringStream.

Thanx!

Greetings
Pat

I have found the solution by my self. The best way to serialize to a
String is using the MemoryStream, from which you can get a Bytearray.
This could be converted to a String!

Greetings
Pat
 
Back
Top