Jump to content
  • Advertisement
Sign in to follow this  
Stompy9999

Winsock and files...

This topic is 4751 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
Advertisement
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


Hi,

Another viable option is Microsoft's WinInet API. It's really quite easy to setup an utilize. You can quite easily create special headers and all the rest.

Later,

GCS584

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!