读取xml文件中的内容并显示在textbox

2025-03-01 16:23:43
推荐回答(2个)
回答1:

using System.Xml.Linq;
//路径
XElement element = XElement.Load(@"d:\text.xml");

//你要的值
string id = element.Descendants("违法ID").FirstOrDefault().Value;

textBox1.Text = id;

回答2:

没见过这么提问的..啥语言都不说..看你这个像是VB吧