With .net2, how do I get the path of where the .EXE is located for a WinForms
app? e.g. for "h:\myapps\testapp\test.exe" , "h:\myapps\testapp\" should
bee returned
Gregg Walker - 26 Jul 2007 23:03 GMT
c#
using System.IO;
using System.Reflection;
...
string pathDir =
Path.GetDirectoryName(Assembly.GetExecutingAssembly().CodeBase);
or if you're really looking for the current directory...
string pathDir = System.Environment.CurrentDirectory;