Members

Technology Zones

IBM Learning Center

Articles

Hosted By

MaximumASP

Info

Rated
Read 24,066 times

Related Categories

Integrate Web Content

How many times have you come across a Web site that contained a
few small kernels of interesting information and wanted to capture
it for display on one of your own pages? You might consider using
a frame, but doing so doesn't let you manipulate the content. As an
alternative, try the Internet Transfer control.

The Internet Transfer Control is an ActiveX COM component that allows
you to easily implement the most common Internet protocols, HTTP and
FTP, with COM-compatible programming languages like Visual Basic and
VBScript. In essence, the Internet Transfer Control provides a wrapper
for the numerous WinInet API functions provided by the Windows
operating system. The control comes with several Microsoft products,
including Visual Studio and Office Developer. You can check your
System directory for the file MSINET.OCX, if you're not sure you have
it registered on your system. To use this control you call it's
openUrl method. This fills a string variable with the URL's raw
html from which you can parse a specific value.

<body>
Weather for San Francisco:
<%
set objInet = CreateObject("InetCtls.Inet")
objInet.requestTimeout = 20

objInet.url = "http://weather.noaa.gov/weather/current/KSFO.html"
strHTML = objInet.openURL
if strHTML = "" then
strHTML = "<No Data Available>"
end if

strHTML = mid(strHTML, instr(strHTML, " Temperature ") + 73)
strHTML = mid(strHTML, 1, instr(strHTML, "C)") + 1)
Response.Write strHTML
Set objInet = Nothing
%>
</body>

Of course, this control may not always be suited to conditions
involving high traffic, low bandwidth, or slow connection speeds.
That said, however, the Internet Transfer Control can still
serve many useful functions.

© 2001 Element K Journals, a division of Element K Press LLC ("Element K"). Element K and the Element K logo are trademarks of Element K LLC

Comments

  • unicod

    Posted by errom on 24 Mar 2004

    I have the same problem here, did you find a solution?

  • I've got problem with unicode

    Posted by liamvn on 10 Feb 2004

    Everything works fine. Thanks a lot.
    But it gets problem when the webpage is written under utf-8 (unicode) encoding. The final result is displayed different with the web source.
    Pls help.
    Thx

  • License Issue

    Posted by imran189 on 20 Oct 2003

    I am having license problem even after registering Msinet.ocx.
    Plz help

  • licence answer...

    Posted by nero on 15 May 2003

    you need to have visual studio installed...

    p.s.: sorry for the latelly answer :( ... but I only have register today :D

  • An Error

    Posted by kwilliams@wn.com.au on 19 May 2002

    I get the following error when trying to execute the script:

    Microsoft VBScript runtime error '800a01ad'

    ActiveX component can't create object: 'InetCtls.inet'


    What is wrong? :confused: