提供的类CFile::Cfile()
读文件:
CFile file("7.txt",CFile::modeRead); char *pBuf; DWORD dwFileLen; dwFileLen=file.GetLength(); pBuf=new char[dwFileLen+1]; pBuf[dwFileLen]=0; file.Read(pBuf,dwFileLen); file.Close(); MessageBox(pBuf);
写文件:
CFile file("7.txt",CFile::modeCreate|CFile::modeWrite); file.Write("dong_yanzhi",strlen("dong_yanzhi")); file.Close();