<ArrayOfBasCzjbm xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://Bestechsoft.com/">
<BasCzjbm>
  <basClerkID xmlns="http://tempuri.org/">1</basClerkID> 
  <BasCode xmlns="http://tempuri.org/">super</BasCode> 
  <BasName xmlns="http://tempuri.org/">系统管理员</BasName> 
  <SuperYn xmlns="http://tempuri.org/">false</SuperYn> 
  <GroupAutoid xmlns="http://tempuri.org/" /> 
  <PassWord xmlns="http://tempuri.org/">super</PassWord> 
  <Visible xmlns="http://tempuri.org/">false</Visible> 
  <DoorAutoid xmlns="http://tempuri.org/" /> 
  <CreatID xmlns="http://tempuri.org/" /> 
  <CreatTime xmlns="http://tempuri.org/">2011-12-08T14:30:07.640625+08:00</CreatTime> 
  <UpdateID xmlns="http://tempuri.org/" /> 
  <UpdateTime xmlns="http://tempuri.org/">2011-12-08T14:30:07.640625+08:00</UpdateTime> 
  <DeleteID xmlns="http://tempuri.org/" /> 
  <DeleteTime xmlns="http://tempuri.org/">2011-12-08T14:30:07.640625+08:00</DeleteTime> 
  <AppField1 xmlns="http://tempuri.org/" /> 
  <AppField2 xmlns="http://tempuri.org/" /> 
  <AppField3 xmlns="http://tempuri.org/" /> 
  <Status xmlns="http://tempuri.org/">0</Status> 
  <Yx xmlns="http://tempuri.org/">false</Yx> 
  <BasShortCode xmlns="http://tempuri.org/" /> 
  <BasPinyin xmlns="http://tempuri.org/" /> 
  <LastOnlineTime xmlns="http://tempuri.org/">0001-01-01 00:00:00</LastOnlineTime> 
  <Online xmlns="http://tempuri.org/">false</Online> 
  </BasCzjbm>
</ArrayOfBasCzjbm>在如上的一个XML中我要读取出<BasName xmlns="http://tempuri.org/">系统管理员</BasName> 里面的"系统管理员"这个值要怎么读?

解决方案 »

  1.   

    XmlDocument xmlDoc = new XmlDocument();
    xmlDoc.Load(Server.MapPath("~/test.xml"));
    XmlNode node = xmlDoc.GetElementsByTagName("BasName")[0];
    Response.Write(node.InnerText);
    xml文件路径你自己改一下。
      

  2.   

    不行呢..因为ArrayOfBasCzjbm节点里面可能有多个BasCzjbm节点..而且每一个BasName的值我都需要获取出来
      

  3.   

    XmlDocument xmlDoc = new XmlDocument();
    xmlDoc.Load(Server.MapPath("~/test.xml"));
    XmlNodeList nodes = xmlDoc.GetElementsByTagName("BasName");
    foreach (XmlNode node in nodes)
    Response.Write(node.InnerText);