public static byte[] Serialize( object objectToSerialize )
Parameters
- objectToSerialize
- The object to serialize.
Return Value
An XML string representing the object.
public static byte[] Serialize( object objectToSerialize )
Car MyCar1 = new Car(); byte[] CarBytes = EncodeHelper.Serialize(MyCar1); string CarXml = XmlUtility.Utf8BytesToString(CarBytes); Car MyCar2 = (Car) Deserialize(CarXml, typeof(Car)); // MyCar2 is now a copy of MyCar1.
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2