开发者

How to get instance of object from XML file?

开发者 https://www.devze.com 2023-04-07 19:19 出处:网络
I have XML file o开发者_C百科f object.I want to get instance of that object.But i dont have class.I must read XML and create dynamically how to say class. How to do?See this page, it can help but you

I have XML file o开发者_C百科f object.I want to get instance of that object.But i dont have class.I must read XML and create dynamically how to say class. How to do?


See this page, it can help but you need .NET 4.


I guess you want to read data from an XML into your class. If so, you can use the following way to read the data from a file.

var records = from r in XElement.Load(@"YourFile.xml").Elements("NodeName")
              select r;
0

精彩评论

暂无评论...
验证码 换一张
取 消