2012-07-01 3 views

답변

2

당신은 XmlSerializer이 클래스를 직렬화 돌봐해야합니다

using System.Text; // needed to specify output file encoding 
using System.Xml; 
using System.Xml.Serialization; // XmlSerializer lives here 

// instance of your generated class 
YourClass c = new YourClass(); 

// wrap XmlTextWriter into a using block because it supports IDisposable 
using (XmlTextWriter tw = new XmlTextWriter(@"C:\MyClass.xml", Encoding.UTF8)) 
{ 
    // create an XmlSerializer for your class type 
    XmlSerializer xs = new XmlSerializer(typeof(YourClass)); 

    xs.Serialize(tw, c); 
} 
+0

는 정말 고마워요! – formatjam