69,371
社区成员
发帖
与我相关
我的任务
分享
FILE *pFile = fopen("D:\\Users\\lihua\\Desktop\\li.txt", "r");
fseek(pFile, 0, SEEK_END);
int nlen = ftell(pFile);
rewind(pFile);
char *buf;
buf = new char[nlen+1];
fread(buf, 1, nlen, pFile);
buf[nlen] = '\0';
CString str(buf);
m_edit.SetWindowText(str);
fclose(pFile);
CFile file(_T("D:\\Users\\lihua\\Desktop\\li.txt"), CFile::modeRead);
ULONGLONG ullLen = file.GetLength();
char *buf = new char[ullLen+1];
file.Read(buf, ullLen);
buf[ullLen] = '\0';
CString str(buf);
m_edit.SetWindowText(str);
file.Close();