using System.IO;
using System.Xml.Serialization;
public void SerializeObject(string filename, PersonnelService.PersonnelInput objectToSerialize)
{
Stream stream = File.Open(filename, FileMode.Create);
XmlSerializer ser = new XmlSerializer(typeof(PersonnelService.PersonnelInput));
ser.Serialize(stream, objectToSerialize);
stream.Close();
}
Friday, October 30, 2009
Serialize Object To File
Subscribe to:
Post Comments (Atom)
This is one of those blogs which I follow regularly because I get to know short and simple method for various concept. This time I learned how serialize object to a file. The code is written in simple language. Thanks for the post.
ReplyDeleteoracle r12 new features