CFILE的使用:读文件
来源:互联网 发布:mac brew gradle home 编辑:程序博客网 时间:2024/06/09 21:33
逐行
/*
CStdioFile sfile;
if(!sfile.Open(dlg2.m_szFilepath,CFile::modeRead))
{
AfxMessageBox("Open file error!");
return;
}
CString strText="" ;
CString szLine ;
while( sfile.ReadString( szLine ) )
{
strText += szLine + "/r/n";
}
m_editFileContent.SetWindowText(strText);
sfile.Close();
*/
显示,不断行
CFile file;
if(!file.Open(dlg2.m_szFilepath,CFile::modeRead))
{
MessageBox("Open file error!");
return;
}
//CString strLine;
char *pbuf;
pbuf = new char[file.GetLength()+10];
memset(pbuf,'/0',file.GetLength()+1);
UINT nBytesRead = file.Read(pbuf, file.GetLength());
m_editFileContent.SetWindowText(pbuf);
file.Close();
delete [] pbuf;
}
- CFILE的使用:读文件
- CFile类的使用
- cfile的使用
- CFile类的使用
- MFC的文件类CFile
- MFC的文件类CFile
- CFile和CArchive的使用
- 使用CFile类对文件进行读写
- 使用CFile类新型文件操作
- VC++之使用CFile类打开文件
- MFC使用CFile读写Unicode字符集文件
- MFC使用CFile读写Unicode字符集文件
- C++ 中 CFile 文件使用教程
- CFile类打开文件的有趣现象
- CFile类打开文件的有趣现象
- CFile和CStdioFile的文件读写使用方法
- CFile和CStdioFile的文件读写使用方法
- CFile和CStdioFile的文件读写使用方法
- dockingpannel开发多文档程序
- 程序员的七种武器1
- ActiveX控件开发的一些问题一,如何标记控件为安全
- JAVA笔试改错题(附答案)
- jvm、jdk、jre的联系与区别
- CFILE的使用:读文件
- 数据库设计范式深入浅出
- Oracle字符串截取
- 常见错误(不段添加中)
- 改变编辑框背景颜色/改变快捷菜单
- Socket编程之-------查询正在使用的端口号??
- FOJ--1589--自动机--解题报告
- 利用Servlet删除硬盘中的文件
- 提升检测机构竞争力 直面市场挑战【转帖】