Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
XMLに書き込む処理
public void SaveXml(List<Person> personList)
{
System.Xml.Serialization.XmlSerializer serializer = new System.Xml.Serialization.XmlSerializer(typeof(Person[]));
// Data.xmlは保存するファイル名
using (System.IO.FileStream fs = new System.IO.FileStream("Data.xml", System.IO.FileMode.Create))
{
serializer.Serialize(fs, personList.ToArray());
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.