110,534
社区成员
发帖
与我相关
我的任务
分享
public string GetNodeValue(string nodename)
{
try
{
using (XmlTextReader reader = new XmlTextReader(System.Windows.Forms.Application.StartupPath + "\\1.xml"))
{
while (reader.Read())
{
if (reader.Name == nodename)
{
return reader.Value;
}
}
return null;
}
}
catch (Exception ex)
{
return ex.ToString();
}