读取这种结构的xml文档
我需要把每个结点都读取出来,如何操作?
<?xml version= "1.0 " encoding= "utf-8 " ?>
<note>
<item name= "Smtp " value= "smtp.foxmail.com "> </item>
<item name= "Port " value= "25 "> </item>
<item name= "Domain " value= "foxmail.com "> </item>
<item name= "UserName " value= "wwww "> </item>
<item name= "Passwd " value= "12345 "> </item>
<item name= "FromAdd " value= "wwww@foxmail.com "> </item>
<item name= "Title " value= "标题 "> </item>
<item name= "Content " value= "测试测试 "> </item>
</note>
------解决方案--------------------StreamReader str=new streamReader( "~/data.xml ");
XmlDataDocument xdd=new XmlDataDocument();
xdd.DataSet.ReadXml(str);
DataTable dt=xdd.DataSet.Tables[0];
Label1.Text=dt.Rows[0][2].ToString();