程序:
CFile f;
f.Open("filename.txt",CFile::modeCreate|CFile::modeWrite)
CArchive ar(&f,CArchive::store);
long i=m_combo.GetCount();
ar<<i;
for(long j=0;j<i;j++)
{
m_combo.GetLBText(i,str);
ar<<str;
}
ar.Close();
f.Close();
}
READ程序:
CFile f;long k;CArrayString m_list;
if(f.Open("filename,CFile:;modeRead)==FSLSE)
return;
CArchive ar(&f,CArchive::load);
ar>>k;
for(long i=0;i<k;i++)
{
ar>>str;
m_list.Add(str);
}
ar.Close();
f.Close();
}
写行,但READ 出ERR
CFile f;
f.Open("filename.txt",CFile::modeCreate|CFile::modeWrite)
CArchive ar(&f,CArchive::store);
long i=m_combo.GetCount();
ar<<i;
for(long j=0;j<i;j++)
{
m_combo.GetLBText(i,str);
ar<<str;
}
ar.Close();
f.Close();
}
READ程序:
CFile f;long k;CArrayString m_list;
if(f.Open("filename,CFile:;modeRead)==FSLSE)
return;
CArchive ar(&f,CArchive::load);
ar>>k;
for(long i=0;i<k;i++)
{
ar>>str;
m_list.Add(str);
}
ar.Close();
f.Close();
}
写行,但READ 出ERR
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货