C#加载xml 除了简单的xmlDoc.Load("test.xml"); 还有什么其他方法呢?

2025-05-09 14:38:11
推荐回答(1个)
回答1:

XmlDocument doc = new XmlDocument();
string path = "";
openFileDialog1.Filter = "XML 文件|*.xml";
if (this.openFileDialog1.ShowDialog() == System.Windows.Forms.DialogResult.OK)
{
path = this.openFileDialog1.FileName;
}
else
{
return;
}
doc.Load(path);
希望能帮助你