How can I retrieve the window directory in C#???

  • Thread starter Thread starter Hans
  • Start date Start date
Hi.

I use the following to retrieve the windows directory:
Directory.GetParent(Environment.SystemDirectory).ToString()

-Neil
 
Can anybody tell me how I can get the windows directory
in C#?

Tanx, Hans

string winDir =
Environment.GetFolderPath(Environment.SpecialFolder.System)

That will retrieve the system folder path - ex. C:\Windows\System32..
Is that what your after?
 

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