INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

read data from web page

read data from web page

(OP)
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

RE: read data from web page

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?

RE: read data from web page

(OP)
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

RE: read data from web page

The syntax is detailed in the VB6 documentation. However, here is a trivial example using a UserControl:

CODE

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 

RE: read data from web page

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.

RE: read data from web page

(OP)
I did find simple way to accomplish this task:
I installed the Microsoft internet transfer control
txtNewVer = Inet1.OpenURL("www.mywebsite.com/ver.txt", icString)

Thank you for your suggestions.
Dan

RE: read data from web page

Nothing like picking the oldest, cruddiest, more problematic option I guess.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close