Obtaining the working directory

  • Thread starter Thread starter Tony
  • Start date Start date
T

Tony

Guys

How do I find the directory that my current application is running in?
e.g. if i wanted to find the current working directory of regedit internally
(i.e. within the regedit program) it would have C:\Winnt returned.

Thanks
 
Hi,

You could use :
Assembly.GetExecutingAssembly().CodeBase

it return the directory of the running assembly

or you can use Environment.CurrentDirectory

Hope this help,
 
Back
Top