日期:2014-05-17 浏览次数:20772 次
string path = @"E:\新建文件夹\App1\App1\XMLFile1.xml";
XmlDocument xmlDoc = new XmlDocument();
xmlDoc.Load(path);
XmlNodeList list = xmlDoc.SelectNodes("/LanguageResource/LangType[@lang='zh-CN']/Menu/MenuItem");
dataGridView1.Columns.Add("a", "语种");
//*************************
dataGridView1.Columns.Add("b", "文本");
foreach (XmlNode menu in list)
{
string title = menu.Attributes["Name"].Value;
//*************************
string text="文本";
dataGridView1.Rows.Add(new string[] { title,text });
}