dialogis a class object OpenFileDialogand I am using a method ShowDialog().
When I use a path containing a relative path, for example:
dialog.InitialDirectory = "..\\abcd";
dialog.InitialDirectory = Directory.GetCurrentDirectory() + "..\\abcd";
ShowDialog()I can only make a specific path starting from disk:
dialog.InitialDirectory = "C:\\ABC\\DEF\\abcd";
In this case, I want the path to be 1 level higher than my current .exe directory, and then down to the directory abcd) The
current .exe path can be found using Directory.GetCurrentDirectory(), which is fine, but I can not continue with "..")
Directory Hierarchy:
ABC
DEF
abcd (where i want)
defg (where .exe is at)
So, is there a way to use "..\\"with InitialDirectory?
Or should I use a specific path with it?
Thank!
source
share