A
Alisa
How can i get the seralization of an object as string?
Can i avoid saving a temporary file?
thanks
Can i avoid saving a temporary file?
thanks
System.Text.Encoding ENCODING = System.Text.Encoding.UTF8;
XmlSerializer ser = new XmlSerializer(obj.GetType());
MemoryStream mem = new MemoryStream();
XmlTextWriter writer = new XmlTextWriter(mem,ENCODING);
ser.Serialize(writer,obj);
return ENCODING.GetString(mem.GetBuffer());
Chris said:You can use an xmlserializer to serialize to xml which can be stored
in a string.