用vc程序怎么获取windows的临时文件夹路径

如题所述

先用GetTempPath获取路径,再用下面函数获取临时文件全路径
GetTempFileName(tmppath, // directory for temp files
"NEW ", // temp file name prefix
0, // create unique name
tmpfile); // buffer for name */
温馨提示:答案为网友推荐,仅供参考
第1个回答  2016-03-07
用SHGetFolderLocation,具体参数看MSDN

GetTempPath

http://msdn2.microsoft.com/en-us/library/aa363875.aspx

先用GetTempPath获取路径,再用下面函数获取临时文件全路径
GetTempFileName(tmppath, // directory for temp files
"NEW ", // temp file name prefix
0, // create unique name
tmpfile); // buffer for name */
相似回答