作者:乔山办公网日期:
返回目录:excel表格制作
CString str =" ";
CStdioFile file;
file.Open("test.txt",CFile::modeRead);//打开文抄件
//逐行读取字符串
while( file.ReadString(str ))
{
//设置到编辑框百
MessageBox(str); //test
}
file.Close();//关闭文件
有什么问题的话度可以追问~
do
{
myFile.ReadString(str1);
str2=str2+str1;
}
while(myFile.ReadString(str1));
你百Read了两次,但有度一次问没有答处理。
可以内这样:容
do
{
myFile.ReadString(str1);
str2=str2+str1;
}
while(str1.Length()>0);
#include "locale"
......
CStdioFile f;
CString str;
if(f.Open(m_filename,CFile::modeRead |专 CFile::typeText))
{
CString s;
setlocale(LC_CTYPE, "chs");
while (f.ReadString(s))
{
属str += s;
}
f.Close();
}
SetDlgItemText(IDC_BUTTON1,str);
excel文件,需要你了解他的文件结构,然后自己写二进制读取,