Path.GetTempPath 方法
返回当前系统的临时文件夹的路径。
**命名空间:**System.IO
**程序集:**mscorlib(在 mscorlib.dll 中)
语法
声明
Public Shared Function GetTempPath As String
用法
Dim returnValue As String
returnValue = Path.GetTempPath
public static string GetTempPath ()
public:
static String^ GetTempPath ()
public static String GetTempPath ()
public static function GetTempPath () : String
返回值
包含临时目录的路径信息的 String。
异常
异常类型 | 条件 |
---|---|
调用方没有所需的权限。 |
备注
下表列出了其他典型或相关的 I/O 任务的示例。
若要执行此操作... |
请参见本主题中的示例... |
---|---|
创建文本文件。 |
|
写入文本文件。 |
|
读取文本文件。 |
|
检索文件扩展名。 |
|
检索文件的完全限定路径。 |
|
检索路径中的文件名和扩展名。 |
|
只检索路径中的文件名。 |
|
只检索路径中的目录名。 |
|
更改文件扩展名。 |
|
确定目录是否存在。 |
|
确定文件是否存在。 |
.NET Framework 安全性
- EnvironmentPermission 用于无限制访问环境变量。关联的枚举:PermissionState.Unrestricted
平台
Windows 98、Windows 2000 SP4、Windows CE、Windows Millennium Edition、Windows Mobile for Pocket PC、Windows Mobile for Smartphone、Windows Server 2003、Windows XP Media Center Edition、Windows XP Professional x64 Edition、Windows XP SP2、Windows XP Starter Edition
.NET Framework 并不是对每个平台的所有版本都提供支持。有关受支持版本的列表,请参见系统要求。
版本信息
.NET Framework
受以下版本支持:2.0、1.1、1.0
.NET Compact Framework
受以下版本支持:2.0、1.0