看一下代码,在SendRequest出现错误,catch得到后szCause的内容是系统找不到指定文件,好像与网络无关,因为我不连线时也是这个错误try
{
CInternetSession * m_InternetSession = NULL;
CHttpConnection * m_HttpConnection = NULL;
CHttpFile * m_httpFile = NULL;m_HttpConnection = m_InternetSession->GetHttpConnection((LPCTSTR)strServer, (INTERNET_PORT )nICBCServerPort, NULL, NULL);m_httpFile = m_HttpConnection->OpenRequestCHttpConnection::HTTP_VERB_POST,"servlet/com.inbs.yhzq.APIReqServlet");int retCode = m_httpFile->AddRequestHeaders(_T("Proxy-Connection: Keep-Alive\r\n"));
CString strHeaders = _T("Content-Type: application/x-www-form-urlencoded");DWORD dwOption = 0;
dwOption = 0x00;
m_InternetSession->SetOption(INTERNET_OPTION_CONNECT_RETRIES,dwOption);
dwOption = 0xFF;
m_InternetSession->SetOption(INTERNET_OPTION_CONNECT_TIMEOUT,dwOption);BOOL bsuc=m_httpFile->SendRequest(strHeaders,(LPVOID)(LPCTSTR)reqData, reqData.GetLength());
}catch (CInternetException* pEx)
{
TCHAR   szCause[1024];
pEx->GetErrorMessage(szCause, 1024);
}