16,472
社区成员
发帖
与我相关
我的任务
分享
CString szPathc = CString(szPath);
CString szPathopen = szPathc + "\\data.txt"; // DATA 内内容 中华人民
//获取路经
CString mass;
CFile ReadeFile;
char buf[1000];//读1K
memset(buf, 0, 1000);//初始化内存,防止读出字符末尾出现乱码
ReadeFile.Open(szPathopen, CFile::modeRead);
ReadeFile.Read(buf, sizeof(buf));
mass = CString(buf);
MessageBox(mass); //输出为什么是空白
ReadeFile.Close();