Click or drag to resize
EnvironmentGetFolderPath Method (EnvironmentSpecialFolder)
Gets the path to the system special folder that is identified by the specified enumeration.

Namespace: System
Assembly: mscorlib (in mscorlib.dll) Version: 4.0.0.0
Syntax
C#
public static string GetFolderPath(
	EnvironmentSpecialFolder folder
)

Parameters

folder
Type: SystemEnvironmentSpecialFolder
An enumerated constant that identifies a system special folder.

Return Value

Type: String
The 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
ExceptionCondition
ArgumentExceptionfolder is not a member of EnvironmentSpecialFolder.
PlatformNotSupportedExceptionThe current platform is not supported.
See Also