void CFileDemoDlg::OnBnClickedButton1()
{
//API
HANDLE handle = CreateFile("D:\\1.txt", 0, FILE_SHARE_READ, NULL, CREATE_ALWAYS, 0, NULL);
if (handle == INVALID_HANDLE_VALUE)
{
MessageBox("创建失败");
}
//MFC
CFile file("D:\\1.txt", CFile::modeCreate);
}