📄 index067.htm
字号:
<html>
<style type="text/css"><!--
.p9 { font-family: "宋体"; font-size: 9pt}a {text-transform: none; text-decoration: none;}
a:hover {text-decoration: underline; color: #FF0000;}
--></style>
<body background="../di2001.jpg">
<h3 align="center"><font COLOR="#AOAO99"></font></h3>
<table width="100%" border="1" cellspacing="1">
<tr><td><p align="center"><font color="#FF0000">在哪儿创建临文件</font></td></tr>
<tr><td><p>
</Br>
调用SDK函数GetTemPath可以确定临时文件的目录,该函数首先为临时路径检测TMP环境变量:如果没有指定TMP,检测TMP环境变量,然后返回到当前目录。下例说明了如何创建一个临时文件。<Br>
</Br>
…<Br>
//get unique temporary file.<Br>
CString strFile<Br>
GetUniqueTempName (strFile)<Br>
TRY<Br>
{<Br>
//Create file and write data.Note that file is closed<Br>
//in the destructor of the CFile object.<Br>
CFile file (strFile,CFile ::modeCreate | CFile:: modeWrite)<Br>
</Br>
//write data<Br>
}<Br>
</Br>
CATCH (CFileException, e)<Br>
{<Br>
//error opening file<Br>
}<Br>
END_CATCH<Br>
…<Br>
</Br>
Void GetuniqueTempName (CString& strTempName)<Br>
{<Br>
//Get the temporary files directory.<Br>
TCHAR szTempPath [MAX_PATH]<Br>
DWORD dwResult=:: GetTempPath (MAX_PATH, szTempPath)<Br>
ASSERT (dwResult)<Br>
</Br>
//Create a unique temporary file.<Br>
TCHAR szTempFile [MAX_PATH]<Br>
UINT nResult=GetTempFileName (szTempPath, _T ("~ex"),0,szTempfile)<Br>
ASSERT (nResult)<Br>
</Br>
strTempName=szTempFile<Br>
}<Br>
</Br>
</p></td></tr>
</table>
</body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -