#include <windows.h>
#include 
<tchar.h>
int  _tmain(int argc,LPTSTR argv[])
{
    HANDLE hFile 
= CreateFile(TEXT("d:\\test.txt"),
        GENERIC_WRITE,
0,NULL,
        CREATE_ALWAYS,
        FILE_ATTRIBUTE_NORMAL,NULL);


    
if(hFile != INVALID_HANDLE_VALUE) 
    {
        DWORD writeBytes 
= 0;
        PTSTR text 
= TEXT("hello,world");
        DWORD len 
= strlen(text);
        WriteFile(hFile,text,len,
&writeBytes,NULL);
        CloseHandle(hFile);
    }
}

相关文章:

  • 2022-01-03
  • 2022-12-23
  • 2021-05-11
  • 2022-12-23
  • 2021-10-31
  • 2022-03-02
  • 2021-12-02
猜你喜欢
  • 2022-12-23
  • 2021-05-28
  • 2021-09-04
  • 2022-01-23
  • 2021-08-22
  • 2021-07-15
  • 2021-08-16
相关资源
相似解决方案