Xml 파일에 개체를 Write.
public class Example
{
public static void Main()
{
WriteXML();
}
public class CodeKiller
{
public String code;
}
public static void WriteXML()
{
CodeKiller overview = new CodeKiller();
overview.code = "Serialization Overview";
System.Xml.Serialization.XmlSerializer writer =
new System.Xml.Serialization.XmlSerializer(typeof(CodeKiller));
var path = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + "//Sample.xml";
System.IO.FileStream file = System.IO.File.Create(path);
writer.Serialize(file, overview);
file.Close();
}
}