I have code that returns a directcotry path in 2 different forms. If in one form I choose the path to open the file and process it, then when I return to another form, I get a Direcotry exception error. I used different lines to get this way
In the second form, I called it:
string strFilePath2;
strFilePath2 = Directory.GetCurrentDirectory();
strFilePath2 = Directory.GetParent(strFilePath2).ToString();
strFilePath2 = Directory.GetParent(strFilePath2).ToString();
strFilePath2 = strFilePath2 + "\\ACH";
In my first form, I called:
strFilePath = Directory.GetCurrentDirectory();
strFilePath = Directory.GetParent(strFilePath).ToString();
strFilePath = Directory.GetParent(strFilePath).ToString();
strFilePath = strFilePath + "\\ACH\\" + Node;
During debugging, I get the selected path from the second form, but not the path I was expecting. Can anyone explain why?
source
share