DWORD dwWritten;
HANDLE hFile;
hFile =CreateFile("C:\\test.txt", GENERIC_READ | GENERIC_WRITE,0, NULL,
OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL );
WriteFile(hFile,bkfile,strlen(bkfile)+1,&dwWritten,NULL);
CloseHandle(hFile);
上面的这段代码就可以在磁盘上创建一个文本文件并写入字符,不知道对你有没有帮助