1
Answer

Using Dialog boxes....

Glenn Patton

Glenn Patton

13y
1.1k
1
Hi All,

I need my open and save dialog boxes to point to the location of the Exe that called them at the moment I have (Vis Studio 2008) set the InitialDirectory to the C: drive which is fine on my Desk Top but the application when released into the wild may well be on a network drive, in the past to get around this problem with ini files I have used:

String INIPath = Directory.GetCurrentDirectory(); 

I cant find a simple way to do it.

 Glenn
Answers (1)
0
Vulpes

Vulpes

NA 98.3k 1.5m 13y
I'd try:

string location = System.Reflection.Assembly.GetExecutingAssembly().Location;
string path = System.IO.Path.GetDirectoryName(location);