G Guest Feb 25, 2004 #1 How can I declare the path \My Documents using an identifier to avoid the following string path= @"\My Documents" ?
How can I declare the path \My Documents using an identifier to avoid the following string path= @"\My Documents" ?
N Neil Cowburn [MVP] Feb 25, 2004 #2 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
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