自己写个程序,写一半不会写了,求各位大虾帮忙:
void CGraduationProgramDlg::OnButton2() 
{
// TODO: Add your control notification handler code here
CStdioFile file1;
CListBox* pListBox=(CListBox*)GetDlgItem(IDC_LIST1);
//打开文件
if (!file1.Open(m_strFilePath1, CFile::modeRead))
{
::AfxMessageBox(_T("文件打开失败。"));
return;
} //读文件

string key = "",value = "";
string Fbuf[50],Sbuf[50];
while (file1.ReadString(strText1))
{
pListBox->AddString(strText1);
        stringstream strSplit((string)strText1);
while (strSplit>>key>>value)
{
trans_map.insert(make_pair(key,value));
}
}
file1.Close();
}
这个函数是一个读取按钮的,读取txt文档后按行读,判断每2行之间不同的地方,并且把这一前一后2个不同的字符串保存到哈希表中,判断部分不会写,高手们帮帮忙把!仅剩的20分了