Bonjour, j'ai un probleme avec un OpenFileDialog
voici ma boucle
private void buttonSelect_Settings_Files_Click(object sender, EventArgs e)
{
OpenFileDialog openFileDialog1 = new OpenFileDialog();
openFileDialog1.InitialDirectory = Application.StartupPath;
openFileDialog1.Filter = "xml files (*.xml)|*.xml";
string SettingsFilePath;
if (openFileDialog1.ShowDialog() == DialogResult.OK)
{
try
{
SettingsFilePath = openFileDialog1.FileName;
textBoxPathSettingsFile.Text = SettingsFilePath;
xSettingsDoc.Load(datafile);
xPathExp = "FilePaths";
XmlNode xNode = xSettingsDoc.SelectSingleNode(xPathExp);
xNode.ChildNodes[2].InnerText = SettingsFilePath;
}
catch (Exception ex)
{
MessageBox.Show("Error: Could not read file from disk. Original error: " + ex.Message);
}
}
}
le problem est que le program n'excecute pas les lignes
xPathExp = "FilePaths";
XmlNode xNode = xSettingsDoc.SelectSingleNode(xPathExp);
xNode.ChildNodes[2].InnerText = SettingsFilePath;
il sors du "try" apres la ligne "xSettingsDoc.Load(datafile);"
Quelqu'un sait pourquoi et comment resoudre ?
Merci