Code: Select all
#include <iostream.h>
#include <wininet.h>
#include <windows.h>
#define NET_ADDR "IP-WILL-GO-HERE"
int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, LPSTR lpCmd, int nShow)
{
HINTERNET hINEt,hConnection,hData;
hINEt = InternetOpen("InetURL/1.0", INTERNET_OPEN_TYPE_PRECONFIG, NULL, NULL, 0);
if (!hINEt) { cout<<"Internet open failed. Please try again!\n"; }
hConnection = InternetConnect(hINEt, NET_ADDR, 80, " "," ", INTERNET_SERVICE_HTTP, 0, 0);
if (!hConnection)
{
cout<<"Internet Connection error...\n";
InternetCloseHandle(hINEt);
}
hData = HttpOpenRequest(hConnection, "GET", "/Tutorials/section.php", NULL, NULL, NULL, INTERNET_FLAG_KEEP_CONNECTION, 0);
cout<<HttpSendRequest( hData, NULL, 0, NULL, 0);
}Regards
Joe