HINTERNET hInternet, hConnect, hRequest;
unsigned long readbytes = 0;
char buffer[1024];
hInternet = InternetOpen ( "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322)", INTERNET_OPEN_TYPE_PRECONFIG, NULL, NULL, 0 );
if ( hInternet )
{
hConnect = InternetConnect( hInternet, "site.com", INTERNET_DEFAULT_HTTP_PORT, NULL, NULL, INTERNET_SERVICE_HTTP, 0, 0 );
if ( hConnect )
{
hRequest = HttpOpenRequest ( hConnect, "GET", url, NULL, NULL, NULL, INTERNET_FLAG_NO_COOKIES | INTERNET_FLAG_RELOAD | INTERNET_FLAG_RESYNCHRONIZE | INTERNET_FLAG_NO_UI | INTERNET_FLAG_HYPERLINK, 0 );
if ( hRequest )
{
if ( HttpSendRequest( hRequest, NULL, 0, NULL, 0 ) )
{
if ( InternetReadFile ( hRequest, buffer, 1024, &readbytes ) )
{
if ( readbytes )
{
/* ....... */
}
}
}
}
InternetCloseHandle ( hRequest );
}
InternetCloseHandle ( hConnect );
}
InternetCloseHandle ( hInternet );