日期:2014-05-17 浏览次数:20761 次
<?xml version="1.0" encoding="utf-8"?>
<Test>
<ID>2465</ID>
<Description>"80"</Description>
<Color>80000008</Color>
<VariableType>4 Bytes</VariableType>
<Address>0x00000000</Address>
<Offsets>
<Offset>0x0</Offset>
<Offset>0x4</Offset>
<Offset>0x8</Offset>
<Offset>0xC</Offset>
</Offsets>
</Test>
class Program
{
static void Main(string[] args)
{
Item item = new Item();
List<Offsets> offsets = new List<Offsets>();
XmlDocument xmlDocument = new XmlDocument();
xmlDocument.Load("test.xml");
XmlNodeList xmlNodeList = xmlDocument.SelectNodes("Test");
foreach (XmlNode node in xmlNodeList)
{
item.ID = Convert.ToInt32(node.SelectSingleNode("ID").InnerText);