Winsock and files...
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!
-----------------------------Play Stompy's Revenge! Now!
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).
Amazing Curves Racing
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
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement