How to retrieve the current exe file path

  • Thread starter Thread starter ThisBytes5
  • Start date Start date
T

ThisBytes5

I have a need to know where my EXE is located, so I can load/save some
settings to a file. In a windows App I would just use
Application.ExecutablePath, but this isn't available in the compact
frame work.

Any ideas?
 
Hi,

By using Reflection. Something like the following should work:

string appName_s=Assembly.GetExecutingAssembly() .GetName() .CodeBase;
string fullAppPath_s = Path.GetDirectoryName(appName_s);

Cheers
Simon.
 
Back
Top