Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

read data from web page 1

Status
Not open for further replies.

dan

MIS
Oct 7, 1998
298
US
I am looking for an easy way to have a VB program look to a text file on the web to compare versions and prompt to update if a newer version is available. I don't want to display the contents of the text file, but only read them into a variable to compare with the current version.
Dan
 
Fetching the data is trivial, and there are umpteen ways to do it including the built in AsyncRead method. Then you'll have to parse your data and check versions, etc. - also a trivial matter but dependent on your data format and how you store the current version.

Is there a question here? Perhaps one not already answered many times?
 
I am not familiar with the AsyncRead method. What syntax would I use to read the text of abc.com/ver.htm into a variable?
Dan
 
The syntax is detailed in the VB6 documentation. However, here is a trivial example using a UserControl:

Code:
[blue]Option Explicit

Private Sub UserControl_Click()
    UserControl.AsyncRead "ftp://ftp.microsoft.com/MISC/disclaim.txt", vbAsyncTypeByteArray 
End Sub

Private Sub UserControl_AsyncReadComplete(AsyncProp As AsyncProperty)
    Debug.Print StrConv(AsyncProp.Value, vbUnicode)
End Sub[/blue]
 
First you asked about a text file, now you say .htm which suggests you haven't thought this through.

Plain text is far easier to deal with for something like this.
 
I did find simple way to accomplish this task:
I installed the Microsoft internet transfer control
txtNewVer = Inet1.OpenURL(" icString)

Thank you for your suggestions.
Dan
 
Nothing like picking the oldest, cruddiest, more problematic option I guess.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top