CFile file;
CString fileName = _T("testStr.txt");
char* read;
CString rStr;
if (file.Open(fileName, CFile::modeRead))
{
UINT nBytes = file.GetLength();
if (nBytes >= 0)
{
read = new char[nBytes +1];
file.Read(read, nBytes);
read[nBytes] = 0;
rStr.Empty();
rStr = CString(read);
delete read;
}
file.Close();
}
댓글 없음:
댓글 쓰기