EnvironmentGetFolderPath Method (EnvironmentSpecialFolder) |
Gets the path to the system special folder that is identified by the specified enumeration.
Namespace: SystemAssembly: mscorlib (in mscorlib.dll) Version: 4.0.0.0
Syntax public static string GetFolderPath(
EnvironmentSpecialFolder folder
)
Parameters
- folder
- Type: SystemEnvironmentSpecialFolder
An enumerated constant that identifies a system special folder.
Return Value
Type:
StringThe path to the specified system special folder, if that folder physically exists on your computer; otherwise, an empty string ("").A folder will not physically exist if the operating system did not create it, the existing folder was deleted, or the folder is a virtual directory, such as My Computer, which does not correspond to a physical path.
Exceptions Exception | Condition |
---|
ArgumentException | folder is not a member of EnvironmentSpecialFolder. |
PlatformNotSupportedException | The current platform is not supported. |
See Also