CInternetSession::OpenURL(...) 连续运行几次后,程序就不能运行 if(((CHttpFile*)mySession.OpenURL(dest))==NULL)连续运行几次后,程序就不能运行debug下连续运行几次后,debug就不能进入该语句且不能跳过该语句大家遇见过这样的情况吗 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 可以用下面的方法试试:CString m_szSite="http://localhost";CString m_szResult;if(m_szSite.Left(7)!="http://") { AfxMessageBox("HTTP site needed!"); return; } m_szResult.Empty(); m_szResult+="Please wait while trying to open "+m_szSite+"\r\n"; UpdateData(FALSE); CInternetSession session; CHttpFile* pFile=NULL; try { pFile=(CHttpFile*)session.OpenURL(m_szSite); } catch(CInternetException* pEx) { pFile=NULL; pEx->Delete(); } if(pFile) { m_szResult+="OK!HTTP Site found!\r\n"; m_szResult+="----------------------\r\n"; CString szLine; while(pFile->ReadString(szLine)) { m_szResult+=szLine+"\r\n"; } pFile->Close(); delete pFile; } else { m_szResult+="Sorry!HTTP Site not found!\r\n"; } session.Close(); 多浏览器插件开发 多线程模拟"等待-通知"模型,有时崩溃,求解 哪位大哥能够提供一个详细讨论mp3文件格式及编解码技术的连接。 求Inside COM源代码 解析XML的问题! 求Visual Assist V6.10.3248的注册码 VC问题 vb 通信前是结构体 在接收端解析后(内存拷贝)仍然转为结构体 请教stdafx.h 和Windows.h的问题。 我已经得到窗口句柄,为什么还不能少激活窗口,让窗口得到焦点。 【一如既往】VC/MFC版1月专家榜 如何通过函数设置ip地址,
CString m_szSite="http://localhost";
CString m_szResult;
if(m_szSite.Left(7)!="http://")
{
AfxMessageBox("HTTP site needed!");
return;
}
m_szResult.Empty();
m_szResult+="Please wait while trying to open "+m_szSite+"\r\n";
UpdateData(FALSE); CInternetSession session;
CHttpFile* pFile=NULL;
try
{
pFile=(CHttpFile*)session.OpenURL(m_szSite);
}
catch(CInternetException* pEx)
{
pFile=NULL;
pEx->Delete();
} if(pFile)
{
m_szResult+="OK!HTTP Site found!\r\n";
m_szResult+="----------------------\r\n";
CString szLine;
while(pFile->ReadString(szLine))
{
m_szResult+=szLine+"\r\n";
}
pFile->Close();
delete pFile;
}
else
{
m_szResult+="Sorry!HTTP Site not found!\r\n";
} session.Close();