在VS6.0显示正常但是2008显示乱码的代码
CInternetSession mySession(NULL,0);
CHttpFile* myHttpFile=NULL;
CString m_strHTML;//="连接到站点" + strURL +" ";
UpdateData(false);
CString myData;
myHttpFile=(CHttpFile*)mySession.OpenURL(CString("http://www.frontfoto.com/photo/search.php?keywords=hello"));
while(myHttpFile->ReadString(myData))
{
m_strHTML+=myData;
}
int j= m_strHTML.GetLength();
int i =m_strHTML.Find(CString("http://www.frontfoto.com/imagex/"));
while (i<j)
{
int k=m_strHTML.Find(CString("http://www.frontfoto.com/imagex/"),i+10);
if(i>k)break;
i=k;
k=m_strHTML.Find(CString("."),i+30);
AfxMessageBox(m_strHTML.Mid(i,k-i+4));
i=k;
}
这段代码的意思是搜索某个网页的符合条件的图像文件,在6。0执行正常可以显示到 但是在2008出现了乱码 有人知道怎么怎么回事儿吗。
如果有人愿意调试的话,加上文件头 #include <afxinet.h>