Windows Default Directories

  • Thread starter Thread starter Elmo Watson
  • Start date Start date
E

Elmo Watson

If I was pointing my app to a particular directory, I would just use:
"C:\Whatever\"

But - If I want my app to use one of the Windows default directories
(Desktop, MyDocuments), since they can be different, depending on which
operating system, so how can I define this in code (like - Desktop)?
 
Elmo Watson said:
But - If I want my app to use one of the Windows default directories
(Desktop, MyDocuments), since they can be different, depending on which
operating system, so how can I define this in code (like - Desktop)?

Check out 'System.Environment.GetFolderPath'.
 
Using event variables (i.e. %Systemroot% for C:\Windows or \Winnt in
2000) would work well also.
 
Back
Top