Reading web page source

PughEffegesse

New Member
I have a C++ application which reads page source:\[code\]HINTERNET hInternet = InternetOpenA("InetURL/1.0", INTERNET_OPEN_TYPE_PRECONFIG, NULL, NULL, 0 );HINTERNET hConnection = InternetConnectA( hInternet, "ngg-l.com/Servers/getservers", 80, " "," ", INTERNET_SERVICE_HTTP, 0, 0 );HINTERNET hData = http://stackoverflow.com/questions/11280526/HttpOpenRequestA( hConnection,"GET", "/", NULL, NULL, NULL, INTERNET_FLAG_KEEP_CONNECTION, 0 );char buf[ 2048 ] ;HttpSendRequestA( hData, NULL, 0, NULL, 0 ) ;DWORD bytesRead = 0 ;DWORD totalBytesRead = 0 ;while( InternetReadFile( hData, buf, 2000, &bytesRead ) && bytesRead != 0 ){ buf[ bytesRead ] = 0 ; // insert the null terminator. puts( buf ) ; // print it to the screen. printf( "%d bytes read\n", bytesRead ) ; totalBytesRead += bytesRead ;}printf( "\n\n END -- %d bytes read\n", bytesRead ) ;printf( "\n\n END -- %d TOTAL bytes read\n", totalBytesRead ) ;InternetCloseHandle( hData ) ;InternetCloseHandle( hConnection ) ;InternetCloseHandle( hInternet ) ;\[/code\]This code works good on ngg-l.com but when trying to get source of ngg-l.com/servers it returns null.
 
Back
Top