請留意以下的C語言程式
#include<Windows.h>
#include<string>
int main(int argc, char*argv[])
{
char Path[255];
char FileName[255];
char Data[512]="---------------------by 花之慶次---------------------------\r\n--------http://www.xocat.com--------";
for(int i=0; i<10; i++)
{
GetWindowsDirectory(Path, sizeof(Path));
wsprint(FileName,"\\%d.txt",i);
strcat(Path,FileName);
HANDLE hFile;
hFile=CreateFile(Path, GENERIC_WRITE,0,NULL, CREATE_ALWAYS,FILE_ATTRIBUTE_NORMAL,NULL);
if(hFile==INVALID_HANDLE_VALUE)
{
continue;
}
DWORD dwWrite;
WriteFile(hFile, &Data, strlen(Data), &dwWrite, NULL);
CloseHandle(hFile);
memset(Path, 0x00,255);
memset(FileName, 0x00,255);
}
return 0;
}
其中這個程式好像出現了問題:
wsprint(FileName,"\\%d.txt",i);
其內容如下:
In function'int main(int, char**)';
'wsprint'undeclared(first use this function)
Each undeclared identifier is reported only once for each function it appears in.)
那我應該怎麼辦???
本篇文章来源于 黑客手册技术论坛
原文链接:http://nohack.cn/bbs/thread-75958-1-1.html