Search Tools Links Login

_ Get webpage source through a simple api call


Visual Basic 6, or VB Classic

Nothing fancy about this, it simply retrieves the source of the url you specify. The best part about this code, is you don't need to add any controls to your code. you just drop in the module, and call one function
[some string]=GetURLSource("http://[some url]")
It's simple and lightweight, and with a little creativity, you could add features like daily news headlines, todays weather forecast, or stock prices to your projects.
If you'e got any questions, feel free to send me a message.

Original Author: Alan Toews

Inputs

url of web page

Assumptions

assumes you are connected to the internet.

Returns

html source of web page

API Declarations

Public Declare Function InternetOpen
Lib "wininet.dll" Alias "InternetOpenA" (ByVal
sAgent As String, ByVal lAccessType As Long,
ByVal sProxyName As String, ByVal sProxyBypass As
String, ByVal lFlags As Long) As Long
Public Declare Function InternetOpenUrl _
Lib "wininet.dll" Alias "InternetOpenUrlA"(ByVal
hInternetSession As Long, ByVal sURL As String, _
ByVal sHeaders As String,ByVal lHeadersLength As _
Long, ByVal lFlags As Long, ByVal lContext As _
Long) As Long
Public Declare Function InternetReadFile _
Lib "wininet.dll" (ByVal hFile As Long, ByVal _
sBuffer As String,ByVal lNumBytesToRead As Long, _
lNumberOfBytesRead As Long) As Integer
Public Declare Function InternetCloseHandle _
Lib "wininet.dll" (ByVal hInet As Long) As Integer

About this post

Posted: 2002-06-01
By: ArchiveBot
Viewed: 93 times

Categories

Visual Basic 6

Attachments

Get webpag217406262001.zip
Posted: 9/3/2020 3:45:00 PM
Size: 2,962 bytes


Loading Comments ...

Comments

No comments have been added for this post.

You must be logged in to make a comment.