What is the C# syntax to retrieve the user's desktop, documents folder and other system folders on windows?
That's just an enum.
Giorgi
2010-09-08 20:02:18
This doesn't actually give you the path - it's an enumeration. You need to use this with Environment.GetFolderPath to get anything useful...
Reed Copsey
2010-09-08 20:02:41
You're right, but a glance at http://msdn.microsoft.com/en-us/library/system.environment.specialfolder.aspx fills in the rest of the details.
Jonathan
2010-09-08 20:04:04
+6
A:
Use:
string folder = Environment.GetFolderPath(Environment.SpecialFolder.*);
Where * is one of the enum values.
Aliostad
2010-09-08 20:00:38
+4
A:
You can use Environment.GetFolderPath with the Environment.SpecialFolder enumeration. For example:
string desktopPath = Environment.GetFolderPath(Environment.SpecialFolder.Desktop);
Reed Copsey
2010-09-08 20:00:41