Sign in to follow this  

Winsock and files...

This topic is 4584 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I was wondering if it is possible to read something like, say, a text file from a URL using Winsock? If so, how? Sorry if this is a dumb question, but I'm still new to the whole network and internet programming thing. Thanks!

Share this post


Link to post
Share on other sites
Quote:
Original post by Stompy9999
I was wondering if it is possible to read something like, say, a text file from a URL using Winsock? If so, how? Sorry if this is a dumb question, but I'm still new to the whole network and internet programming thing.

Thanks!


1. Connect to the website using a TCP socket on port 80.
2. Use the HTTP GET command to retreive the file. You send a formated string to the webserver and read back the result. Since it's all printable text (some characters have to be escaped/translated), it's relatively easy to figure out/debug.

Example program. I don't use VB, but it's a quick example found with google.

Here is perhaps a better example. See the GetHTTP*.zip files (there a few).

Share this post


Link to post
Share on other sites

This topic is 4584 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this