void CFile1Dlg::OnWrite()
{
// TODO: Add extra validation here
UpdateData();
CFile cf;
char ch[100];
cf.Open("d://aits.txt",CFile::modeCreateCFile::modeWrite);
strcpy(ch,m_edit1);
cf.Write(ch,m_edit1.GetLength());
cf.Close(); m_edit1="";
UpdateData(FALSE);
}void CFile1Dlg::OnRead()
{
// TODO: Add your control notification handler code here
CFile cf;
char ch[100];
UpdateData();
cf.Open("d://aits.txt",CFile::modeRead);
cf.Read(ch,cf.GetLength());
for(unsigned int i=0;i
{
{
m_edit1+=ch[i];
}
cf.Close();
UpdateData(FALSE);
}
No comments:
Post a Comment