各位大哥小弟在编写一个工具时候,不能将地址转换成数据。
就是2个词典进行比较把不相等的单词以及解释复制到第一个里面使它变的更加完善。
目前只能复制单词和地址
就是不能把单词解释也复制过去
请各位大哥给指点一下。
非常着急 谢谢、。、
void CBeyondDlg::OnButton3()
{
// TODO: Add your control notification handler code here
CString s8000, slw, stemp8000, stemplw;
CStdioFile fFile8000, fFilelw;
CStdioFile fdestFile;
BOOL bFlag;
int temp;
fdestFile.Open(_T("f:\\词典缺少单词.txt"), CFile::modeCreate|CFile::modeReadWrite); bFlag = TRUE; if(NULL==fFile8000.Open(OpenListFile, CFile::modeRead))
return;
if(NULL==fFilelw.Open(ContrastListFile, CFile::modeRead))
return;
//int i =0;
//while(fFile8000.GetPosition() < fFile8000.GetLength())
//{
// fFile8000.ReadString(mWordList[i]);
// i++;
//}
//int nPostion = mWordList[i].ReverseFind(':');
//CString nString = mWordList[i].Right(mWordList[i].GetLength()-nPostion-1);
//int nTemp = atoi(nString); //int nMost = mWordList2[i].ReverseFind(':');
//CString smoent = mWordList2[i].Right(mWordList2[i].GetLength()-nMost-1);
//int nTemp1= atoi(nString); // FileGetUnicodeData();
fFile8000.ReadString(s8000);
stemp8000 = s8000;
stemp8000.TrimLeft('#');
stemp8000.MakeLower(); while(bFlag)
{
if(!fFilelw.ReadString(slw))
break; stemplw = slw; stemplw.TrimLeft('#');
stemplw.MakeLower(); if(stemplw > stemp8000)
{
fdestFile.WriteString(s8000 + _T("\n"));
while(bFlag)
{
if(!fFile8000.ReadString(s8000))
{
bFlag = FALSE;
}
else
{
stemp8000 = s8000;
stemp8000.TrimLeft('#');
stemp8000.MakeLower(); if(s8000 == _T("#aborigines"))
temp = 0;
} if(stemplw > stemp8000)
{
fdestFile.WriteString(s8000 + _T("\n"));
}
else if(stemplw == stemp8000)
{
if(!fFile8000.ReadString(s8000))
{
bFlag = FALSE;
}
else
{
stemp8000 = s8000;
stemp8000.TrimLeft('#');
stemp8000.MakeLower(); if(s8000 == _T("#aborigines"))
temp = 0;
}
break;
}
else
break;
}
}
else
{
if(stemplw == stemp8000)
{
if(!fFile8000.ReadString(s8000))
{
bFlag = FALSE;
}
else
{
stemp8000 = s8000;
stemp8000.TrimLeft('#');
stemp8000.MakeLower(); if(s8000 == _T("#aborigines"))
temp = 0;
}
}
}
} if(bFlag)
{
while(fFile8000.ReadString(s8000))
fdestFile.WriteString(s8000 + _T("\n"));
}
fdestFile.Close();
fFilelw.Close();
fFile8000.Close(); AfxMessageBox(_T("操作成功!"));
CDialog::OnOK();
}
就是2个词典进行比较把不相等的单词以及解释复制到第一个里面使它变的更加完善。
目前只能复制单词和地址
就是不能把单词解释也复制过去
请各位大哥给指点一下。
非常着急 谢谢、。、
void CBeyondDlg::OnButton3()
{
// TODO: Add your control notification handler code here
CString s8000, slw, stemp8000, stemplw;
CStdioFile fFile8000, fFilelw;
CStdioFile fdestFile;
BOOL bFlag;
int temp;
fdestFile.Open(_T("f:\\词典缺少单词.txt"), CFile::modeCreate|CFile::modeReadWrite); bFlag = TRUE; if(NULL==fFile8000.Open(OpenListFile, CFile::modeRead))
return;
if(NULL==fFilelw.Open(ContrastListFile, CFile::modeRead))
return;
//int i =0;
//while(fFile8000.GetPosition() < fFile8000.GetLength())
//{
// fFile8000.ReadString(mWordList[i]);
// i++;
//}
//int nPostion = mWordList[i].ReverseFind(':');
//CString nString = mWordList[i].Right(mWordList[i].GetLength()-nPostion-1);
//int nTemp = atoi(nString); //int nMost = mWordList2[i].ReverseFind(':');
//CString smoent = mWordList2[i].Right(mWordList2[i].GetLength()-nMost-1);
//int nTemp1= atoi(nString); // FileGetUnicodeData();
fFile8000.ReadString(s8000);
stemp8000 = s8000;
stemp8000.TrimLeft('#');
stemp8000.MakeLower(); while(bFlag)
{
if(!fFilelw.ReadString(slw))
break; stemplw = slw; stemplw.TrimLeft('#');
stemplw.MakeLower(); if(stemplw > stemp8000)
{
fdestFile.WriteString(s8000 + _T("\n"));
while(bFlag)
{
if(!fFile8000.ReadString(s8000))
{
bFlag = FALSE;
}
else
{
stemp8000 = s8000;
stemp8000.TrimLeft('#');
stemp8000.MakeLower(); if(s8000 == _T("#aborigines"))
temp = 0;
} if(stemplw > stemp8000)
{
fdestFile.WriteString(s8000 + _T("\n"));
}
else if(stemplw == stemp8000)
{
if(!fFile8000.ReadString(s8000))
{
bFlag = FALSE;
}
else
{
stemp8000 = s8000;
stemp8000.TrimLeft('#');
stemp8000.MakeLower(); if(s8000 == _T("#aborigines"))
temp = 0;
}
break;
}
else
break;
}
}
else
{
if(stemplw == stemp8000)
{
if(!fFile8000.ReadString(s8000))
{
bFlag = FALSE;
}
else
{
stemp8000 = s8000;
stemp8000.TrimLeft('#');
stemp8000.MakeLower(); if(s8000 == _T("#aborigines"))
temp = 0;
}
}
}
} if(bFlag)
{
while(fFile8000.ReadString(s8000))
fdestFile.WriteString(s8000 + _T("\n"));
}
fdestFile.Close();
fFilelw.Close();
fFile8000.Close(); AfxMessageBox(_T("操作成功!"));
CDialog::OnOK();
}
应该单词,解释连在一起的么?
那样直接字符串截取就行了,如果是动态查询的话,把调用函数的返回值拷贝就可以了
其实楼上你说滴
我了解
但是具体操作
我还是无法去执行
----
自己现在也在研究~~