How to map XML file content to C# object(s)

后端 未结 2 1541
说谎
说谎 2021-01-07 21:55

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:

    
          


        
2条回答
  •  野趣味
    野趣味 (楼主)
    2021-01-07 22:29

    You can use the XmlSerializer class to serialize CLR Objects into XML. Here is the MSDN documentation with some sample code : http://msdn.microsoft.com/en-us/library/system.xml.serialization.xmlserializer.aspx

提交回复
热议问题