-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTEST_create_temp_file.cpp
29 lines (25 loc) · 1.05 KB
/
TEST_create_temp_file.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#include <stdio.h>
//#include <stdlib.h>
//#include <time.h>
//#include <string.h>
#include "create_temp_file.h"
int main(void)
{
char szSysTempPath[256];
char *pszSysTempPath;
char szFileName[256];
int iLen;
char szBuffer[1024] = "<html>\n<head>\n<title>Sample HTML Resource (UNICODE)</title>\n<body background=\"./bitmap.bmp\" body oncontextmenu=self.event.returnValue=false onselectstart=\"return false\">\n<p align=\"center\"><font color=\"#FFFFFF\">This is a sample HTML resource.</font></p>\n<p>The background image is a bitmap that is another resource in the .EXE.</p>\n<p>The resource is a UNICODE-encoded HTML document.</p>\n</html>";
pszSysTempPath = getenv("TEMP");
doGenerateTempFile(szFileName, szBuffer);
sprintf(szSysTempPath, "%s", pszSysTempPath);
iLen = strlen(szSysTempPath);
if(szSysTempPath[iLen] != '\\'){
szSysTempPath[iLen] = '\\';
szSysTempPath[iLen + 1] = '\0';
}
printf("%s---%s\n", szSysTempPath, pszSysTempPath);
getchar();
doDeleteTempFile(szFileName);
return 0;
}