网站首页  词典首页

请输入您要查询的函数:

 

术语 gettemppath
释义 GetTempPath
语法:
C++
DWORD WINAPI GetTempPath(
__in DWORD nBufferLength,
__out LPTSTR lpBuffer
);
GetTempPath函数
检索路径为临时文件指定的目录。
参数
nBufferLength [in]
由lpBuffer确定的字符串缓冲区大小,以TCHARs。
lpBuffer [out]
一个字符串缓冲区,它接收NULL结尾的字符串指定的临时文件路径的指针。返回的字符串结尾反斜杠,例如,C:\\温度\\。
返回值
如果函数成功,返回值是长度,TCHARs,复制到lpBuffer字符串,不包括终止空字符。如果返回值大于nBufferLength更大,返回值是长度,TCHARs,所需要的保存路径缓冲区。
如果函数失败,返回值是零。为了获得更多错误信息,调用GetLastError。
备注
对于环境变量按下列顺序存在GetTempPath功能检查,并使用第一个路径中:
由TMP环境变量指定的路径。
由TEMP环境变量指定的路径。
由下USERPROFILE环境变量指定的路径。
Windows目录。
请注意,该函数不检查路径存在。
符号链接的行为,如果路径指向一个符号链接,临时路径名称维持任何符号链接。
实例
有关示例,请参见创建和使用临时文件。
要求:
最低支持:client-Windows 2000专业版
最低支持server-Windows 2000服务器
HeaderWinBase.h(头文件:winuser.h)
LibraryKernel32.lib
DLLKernel32.dll
Unicode和ANSI namesGetTempPathW(Unicode)和GetTempPathA(ANSI)的
参见
文件管理函数
GetTempFileName
符号链接
如果有任何问题和意见,请发送给微软(wsddocfb@microsoft.com)
生成日期:2009年9月3日
==英文原文==GetTempPath Function
Retrieves the path of the directory designated for temporary files.
Syntax
C++
DWORD WINAPI GetTempPath(
__in DWORD nBufferLength,
__out LPTSTR lpBuffer
);
Parameters
nBufferLength [in]
The size of the string buffer identified by lpBuffer, in TCHARs.
lpBuffer [out]
A pointer to a string buffer that receives the null-terminated string specifying the temporary file path. The returned string ends with a backslash, for example, C:\\TEMP\\.
Return Value
If the function succeeds, the return value is the length, in TCHARs, of the string copied to lpBuffer, not including the terminating null character. If the return value is greater than nBufferLength, the return value is the length, in TCHARs, of the buffer required to hold the path.
If the function fails, the return value is zero. To get extended error information, call GetLastError .
Remarks
The GetTempPath function checks for the existence of environment variables in the following order and uses the first path found:
The path specified by the TMP environment variable.
The path specified by the TEMP environment variable.
The path specified by the USERPROFILE environment variable.
The Windows directory.
Note that the function does not verify that the path exists.
Symbolic link behavior—If the path points to a symbolic link, the temp path name maintains any symbolic links.
Examples
For an example, see Creating and Using a Temporary File .
Requirements
Minimum supported clientWindows 2000 Professional
Minimum supported serverWindows 2000 Server
HeaderWinBase.h (include Windows.h)
LibraryKernel32.lib
DLLKernel32.dll
Unicode and ANSI namesGetTempPathW (Unicode) and GetTempPathA (ANSI)
See Also
File Management Functions
GetTempFileName
Symbolic Links
Send comments about this topic to Microsoft
Build date: 9/3/2009
==原始网址==http://msdn.microsoft.com/en-us/library/aa364992(VS.85).aspx\n
随便看

 

windows api函数参考手册包含2258条windows api函数文档,详细介绍nodejs、java、rust调用windows api的方法技巧,是学习windows api编程的入门中文文档。

 

Copyright © 2004-2023 Winrtm.com All Rights Reserved
京ICP备2021023879号-40 更新时间:2024/10/6 11:28:35