<ID>100</_ID>
结束标记 '_ID' 与开始标记 'ID' 都不匹配!

解决方案 »

  1.   

    这个地方是我刚才在提问的时候做的修改
    其实这个地方是MESSAGE_ID的
      

  2.   

    “未将对象引用设置到对象的实例”在哪一行,那一行肯定是个null,你看看是不是new对象时出错了!
      

  3.   

    在string ID = node.Attributes["ID"].InnerText;
    这行出错了
      

  4.   

    string ID = node.Attributes["ID"].InnerText;string DATE = node.Attributes["DATE"].InnerText;string TIME = node.Attributes["TIME"].InnerText;
    这3行都是报这个错误
      

  5.   

    你看看XmlNode node = x.SelectSingleNode("/MESSAGE");运行后node的值是不是null!
      

  6.   

    改为XmlNode node = x.SelectSingleNode("MESSAGE");
      

  7.   

    node不是null 
    做了这个XmlNode node = x.SelectSingleNode("MESSAGE");修改之后还是报那个错误
      

  8.   

    很多错误:1、string file = "d:/test1.xml"; //改为string file = @"d:/test1.xml";2、string ID = node.Attributes["ID"].InnerText;
       //id ,date,time 不是属性,而是节点,
       //改为:string ID = node.ChildNodes[0].InnerText;
      string DATE = node.Attributes["DATE"].InnerText;
      //改为:string ID = node.ChildNodes[1].InnerText;
      string TIME = node.Attributes["TIME"].InnerText;
      //改为:string ID = node.ChildNodes[2].InnerText;