Directory identifier

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

How can I declare the path \My Documents using an identifier to avoid the following

string path= @"\My Documents"

?
 
Aris,

Check out the OpenNETCF.EnvironmentEx class. It has the GetFolderPath
method which will allow you to do something like this:

string path =
EnvironmentEx.GetFolderPath(EnvironmentEx.SpecialFolder.Personal);

Alternatively, you can P/Invoke SHGetSpecialFolderPath yourself using
CSIDL_PERSONAL.

Note: this is not supported on Pocket PC 2002 or earlier.

HTH
Neil

--
Neil Cowburn, MVP
Co-founder, OpenNETCF.org
Technologist, Content Master Ltd
Microsoft .NET Compact Framework MVP

www.opennetcf.org | www.contentmaster.com
 
Back
Top