CStdioFile读取文件

CStdioFile file;
CString FileName = _T(".\\testItems\\lightSensor_Script.txt");
if (!file.Open(FileName, CFile::typeText | CFile::shareDenyNone))
{
CString sMsg; 
sMsg.Format(_T("Open file %s failed."), FileName);
AfxMessageBox(sMsg);
return -1;
}
sALSScript = _T("");
CString str = _T("");
while (file.ReadString(str))
{
sALSScript += str + _T("\r\n");

}




你可能感兴趣的:(file,VC)