j'ai le code qui récupère un chemin de direcotry sous 2 formes différentes. Si, dans une forme, je sélectionne un chemin pour ouvrir un fichier et le traiter, lorsque je retourne à l'autre formulaire, j'obtiens une erreur Direcotry Exception. Je l'habitude de chaînes différentes pour obtenir ce cheminPourquoi le chemin est changé se
Dans la deuxième forme, j'ai appelé ceci:
string strFilePath2;
strFilePath2 = Directory.GetCurrentDirectory();
strFilePath2 = Directory.GetParent(strFilePath2).ToString();
strFilePath2 = Directory.GetParent(strFilePath2).ToString();
strFilePath2 = strFilePath2 + "\\ACH";
Dans ma première forme, j'ai appelé:
strFilePath = Directory.GetCurrentDirectory();
strFilePath = Directory.GetParent(strFilePath).ToString();
strFilePath = Directory.GetParent(strFilePath).ToString();
strFilePath = strFilePath + "\\ACH\\" + Node;
Pendant le débogage, je reçois sélectionné chemin de la deuxième forme, mais pas le chemin que je m'attendais. Quelqu'un peut-il dire pourquoi?
S'il vous plaît mettre à l'exception de la question. –