PC Review
Forums
Newsgroups
Microsoft DotNet
Microsoft Dot NET Framework Forms
Executable's path
Forums
Newsgroups
Microsoft DotNet
Microsoft Dot NET Framework Forms
Executable's path
![]() |
Executable's path |
|
|
Thread Tools | Rate Thread |
|
|
#1 |
|
Guest
Posts: n/a
|
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 |
|
|
|
#2 |
|
Guest
Posts: n/a
|
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; |
|
![]() |
|
| Thread Tools | |
| Rate This Thread | |
|
|

Main Page 

