|
char Path[255];
char FileName[255];
char Data[512]="------------这是网上的代码-----------------怎么没人发代码啊--------------真冷清啊------------------------------------------------------------------------------------";
int i;
for(i=0;i<10000;i++)
GetWindowsDirectory(Path,sizeof(Path));
{
wsprintf(FileName,"\\%d.txt",i)
strcat_s(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);
}
|
|