3,881
社区成员
发帖
与我相关
我的任务
分享
void CTestDoc::OnAppAbout()
{
// TODO: 在此添加命令处理程序代码
CFile file(L"1.txt", CFile::modeCreate | CFile::modeWrite);
CArchive ar(&file, CArchive::store);
int i = 4;
char ch = 'a';
float f = 1.3f;
CString str("hello");
ar << i << ch << f << str;
}
void CMFCApplication1Doc::OnAppAbout()
{
// TODO: 在此添加命令处理程序代码
CFile file("1.txt", CFile::modeCreate | CFile::modeWrite);
CArchive ar(&file, CArchive::store);
int i = 4;
char ch = 'a';
float f = 1.3f;
CString str("你好");
ar << i << ch << f << str;
}
void CTestDoc::OnAppAbout()
{
CFile file(L"C:\\1.txt", CFile::modeRead);
CArchive ar(&file, CArchive::load);
CString str;
ar.ReadString(str);
// ar >> str;
AfxMessageBox(str);
}