Created
March 15, 2017 07:27
-
-
Save peyangu/983052d17dc4a565e3d81edf3a67bb73 to your computer and use it in GitHub Desktop.
XMLから読み込む処理
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public List<Person> LoadXml() | |
{ | |
Person[] loadAry; | |
System.Xml.Serialization.XmlSerializer serializer = new System.Xml.Serialization.XmlSerializer(typeof(Person[])); | |
using (System.IO.StreamReader sr = new System.IO.StreamReader("Data.xml", new System.Text.UTF8Encoding(false))) | |
{ | |
loadAry = (Person[])serializer.Deserialize(sr); | |
} | |
return loadAry.ToList(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment