Contact Info

Crumbtrail » Network Component » Network Component Objects » Http

ActiveXperts Network Component Http Object

Today, there are many software packages available to check web sites, like availability, contents, bandwidth, changes, etc.. However, most of these software tools are stand-alone packages, without scripting options. Network Component is very well suited for scripting and embedding in applications.

The Network Component Http object allows you to read web pages completely, so you can perform your own content checking. Use the Network Component Http object to:

The Network Component Http object features the following:

The Http object is part of the Network Component. Overview of all Network Component objects:

DnsServer & DnsRecord - Ftp & FtpFile - Http - Icmp - IPtoCountry - Msn - Ntp - Radius - Rsh - Scp - SFtp - Ssh - SnmpManager - SnmpTrapManager - SnmpMibBrowser - Tcp - Tftp - TraceRoute - Udp - Xen - Wake-on-LAN - Xen (Citrix)

Http Sample code

VBScript sample: Read a web site

Set objHttp = CreateObject("ActiveXperts.Http")

 strUrl = inputbox( "Enter URL", "Input", "" )
Loop until strUrl <> ""

objHttp.Connect( strUrl )
If( objHttp.LastError = 0 ) Then
 strData = objHttp.ReadData
 If( objHttp.LastError = 0 ) Then
   WScript.Echo strData
 End If
 WScript.Echo "Disconnect."
End If
WScript.Echo "Ready."

Visual C++ sample: Read a web site

IHttp    *pHttp;
BSTR     bstrTemp

CoInitialize( NULL );
hr = CoCreateInstance( CLSID_Http, NULL, CLSCTX_INPROC_SERVER, 
                      IID_IHttp, (void**) &pHttp);
pHttp->put_ProxyServer( _bstr_t( ( LPCSTR ) "proxy01" ) );
pHttp->Connect( _bstr_t( "" ) );
pHttp->get_LastError( &lLastError );
if( lLastError != 0L )  goto _End;
pHttp->ReadData( &bstrTemp );
pHttp->get_LastError( &lLastError );
if( lLastError != 0L )  goto _End;
printf( "%ls\n", bstrTemp );
SysFreeString( bstrTemp );

On, you can find a lot of Network Component samples. These samples are also part of the Network Component installation.