-
-
未解决
[求助]写入文件乱码,不知怎么解决
-
发表于:
2019-6-27 00:35
2457
-
#include <Windows.h>
int _tmain(int argc, _TCHAR* argv[])
{
TCHAR FileName[MAX_PATH];
HANDLE FileHandle;
lstrcpy(FileName,L"D:\\你好.txt");
FileHandle = CreateFile(FileName,GENERIC_WRITE,FILE_SHARE_WRITE,NULL,
CREATE_ALWAYS,FILE_ATTRIBUTE_NORMAL,NULL);
TCHAR Wbuffer[MAX_PATH] = L"你好";
DWORD nWrite;
WriteFile(FileHandle,Wbuffer,MAX_PATH,&nWrite,NULL);
}
[注意]传递专业知识、拓宽行业人脉——看雪讲师团队等你加入!