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,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top