How to map XML file content to C# object(s)
问题 I am new to C# and I am trying to read an XML file and transfer its contents to C# object(s). e.g. An example XML file could be: <people> <person> <name>Person 1</name> <age>21</age> </person> <person> <name>Person 2</name> <age>22</age> </person> </people> .. could be mapped to an array of C# class called 'Person': Person[] people; Where a Person object could contain the following fields: string name; uint age; 回答1: It sounds like you want use XML serialization. There is a lot already out