当我运行我的方法时,我收到错误:
System.ArgmentException:字符串未被识别为有效的 uri
private void loadXMLBttn_Click(object sender, RoutedEventArgs e)
{
OpenFileDialog selectConfigFile = new OpenFileDialog();
selectConfigFile.Title = "Select an existing XML config file...";
selectConfigFile.InitialDirectory = @"C:\";
selectConfigFile.DefaultExt = ".xml";
selectConfigFile.Filter = "xml files|.xml|All files (*.*)|*.*";
var selectedFile = selectConfigFile.SafeFileName;
selectConfigFile.ShowDialog();
XDocument configFile = XDocument.Load(selectedFile);
}
aluckdog
青春有我
相关分类