高手告诉我吧,两个文本文件怎么比较.
void CHDDInfoDlg::OnText()
{
CString filename;
CString str;
// CSaveReadDoc *pDoc=GetDocument();
// UpdateData();
filename="testinfo.txt";
CStdioFile file;
if(file.Open(filename,CFile::modeCreate|CFile::modeWrite|CFile::typeText)==0)
{
str="create file"+filename+"fail";
AfxMessageBox(str); //create file fail and return the fail information
}
str.Format("%s\n",m_cpu); //input string
file.WriteString(str);
str.Format("%s\n",m_stPhysicalMemory);
file.WriteString(str);
str.Format("%s\n",m_stHDDInfo);
file.WriteString(str);
str.Format("%s\n",m_stCDROMInfo);
file.WriteString(str);
str.Format("%s\n",m_stMouseInfo);
file.WriteString(str);
str.Format("%s\n",m_stMouseInstall);
file.WriteString(str);
str.Format("%s\n",m_stKeyboardInfo);
file.WriteString(str);
str.Format("%s\n",m_stKeyFun);
file.WriteString(str);
str.Format("%s\n",m_stFloppyInfo);
file.WriteString(str);
file.SetLength(file.GetPosition());//set file length
file.Close();//close file
str="notepad"+filename;
WinExec(str,SW_SHOW); //use notepad open the *.txt
}
生成的文本文件怎么与他的另一个文本文件比较,各位大哥可否给小妹一点意见,谢谢