提取xml文件显示
1\
/*** 提DataSet*/
2\
DataSet ds = new DataSet();
ds.ReadXml(p_strXmlPath);
dataGrid1.DataSource=ds;
dataGrid1.DataMember="user";
3\
FileStream fs = new FileStream(p_strXmlPath,FileMode.Open,FileAccess.Read);
StreamReader Reader = new StreamReader(fs,System.Text.Encoding.Default);
DataSet ds = new DataSet();
ds.ReadXml(Reader);
txtName.Text=ds.GetXml();
string physicalName =dt.Rows[0]["username"].ToString();
4\
XmlDocument xmlD = new XmlDocument();
xmlD.Load(p_strXmlPath);
//XmlNamespaceManager xmlns = new XmlNamespaceManager(xmlD.NameTable); //带 xmlns的处理
XmlNode root = xmlD.SelectSingleNode("myinfo"); //,xmlns;
MessageBox.Show(root.InnerText);