Click or drag to resize
EnvironmentGetFolderPath Method (EnvironmentSpecialFolder, EnvironmentSpecialFolderOption)
Gets the path to the system special folder that is identified by the specified enumeration, and uses a specified option for accessing special folders.

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

Parameters

folder
Type: SystemEnvironmentSpecialFolder
An enumerated constant that identifies a system special folder.
option
Type: SystemEnvironmentSpecialFolderOption
Specifies options to use for accessing a 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
PlatformNotSupportedExceptionPlatformNotSupportedException
See Also