CFile file("1.txt",CFile::modeCreate | CFile::modeWrite);你开始的时候打开文件没有关闭它,使用完它以后执行
file.Close()
然后再if(CFile file1("1.txt",CFile::modeRead)){。。}