Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
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