CInternetSession oInternetSession(_T("Watchdog")); UINT nBytesRead ; CHttpConnection* pConnection = NULL; CHttpFile* pHttpFile = NULL; CString strUserName = _T(""); CString strPassword = _T(""); DWORD dwStatusCode; char* chBuffer = new char[1024]; CString strLog; try { pConnection = oInternetSession.GetHttpConnection(m_strHttpServer, (INTERNET_PORT) m_nHttpPort, strUserName, strPassword); //Open Request and get the HttpFile pHttpFile = pConnection->OpenRequest(1, m_strHttpObjectName ,NULL, 1, NULL, NULL,INTERNET_FLAG_RELOAD); //Send Request pHttpFile->SendRequest(); } catch(CInternetException* pe) { TCHAR ExcText[1024]; pe->GetErrorMessage(ExcText, 1023); TRACE(_T("WinInet exception %s\n"), ExcText); strLog.Format(_T("Accessing Url: %s:%d/%s failed. Reason: %s"), m_strHttpServer,m_nHttpPort, m_strHttpObjectName, ExcText); m_pLogger->Log(LOGPRIO_HIGH, strLog); pe->Delete(); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)