今天遇到的部分说明如下:
// TODO: 在此添加控件通知处理程序代码
CStdioFile file;
// int duan=0;
CString strLine;
CString str;
file.Open(_T("D:\\abc.txt"),CFile::modeRead);
while(file.ReadString(strLine))
{
str += strLine;
}
file.Close();
CString str_x = str.Mid(0,2);
CString str_y = str.Mid(3,2);
CString str_width = str.Mid(6,3);
CString str_height = str.Mid(10,3);
AfxMessageBox(str_x);
AfxMessageBox(str_y);
AfxMessageBox(str_width);
AfxMessageBox(str_height);
读取txt文件中的值
CSTring字符的每一位字符的读取方式
http://baike.baidu.com/link?url=k4pzyPPFEplcO7ica4gFYG4MrFu4DdOXcKN7IK2hzv0WPRbv4gFWGERQEiyU4GozLlwj68wbZfA0XUz2hLEoCK