System.IO.Path.GetTempPath Method

Returns the path of the current user's temporary folder.

Syntax

public static string GetTempPath ()

Returns

The path to the temporary folder, ending with a backslash.

Exceptions

TypeReason
System.Security.SecurityExceptionThe caller does not have the required permission.

Remarks

This method checks for the existence of environment variables in the following order and uses the first path found:

[The 'ordered' type of list has not been implemented in the ECMA stylesheet.]

Permissions

TypeReason
System.Security.Permissions.EnvironmentPermissionRequires unrestricted access to environment variables. See System.Security.Permissions.PermissionState.Unrestricted.

Requirements

Namespace: System.IO
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0, 4.0.0.0