Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- HINTERNET hSession = InternetOpen( L"http generic", INTERNET_OPEN_TYPE_PRECONFIG,
- NULL, NULL, 0);
- HINTERNET hConnection = InternetConnect(hSession, strIP,
- INTERNET_DEFAULT_HTTP_PORT, NULL, NULL, INTERNET_SERVICE_HTTP, 0, NULL);
- HINTERNET hRequest = HttpOpenRequest(hConnection, L"GET", sFormat, NULL, NULL, (LPCWSTR*) "*/*\0", 0, NULL);
- BOOL bReturn = HttpSendRequest(hRequest, NULL, 0, NULL, 0);
- char szReadBuffer[2048+1] = { NULL };
- DWORD dwRead = 0;
- CString strReturnData = L"";
- do {
- bReturn = InternetReadFile(hRequest, szReadBuffer, 2048, &dwRead);
- szReadBuffer[2048] = '\0';
- strReturnData += szReadBuffer;
- ZeroMemory(szReadBuffer, 2048);
- } while (dwRead != FALSE);
- InternetCloseHandle(hRequest);
- InternetCloseHandle(hConnection);
- InternetCloseHandle(hSession);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement