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);
希望能帮助你