Skip to main content
gamedev.net
🔒 Locked

Getting a document via HTTP

Started by ziplux Oct 17, 2000 at 10:30 PM 3 replies 250+ views
Original Post
ziplux
ziplux
Does anyone know how I can retrive a document via the HTTP protocol in MS Visual C++? For example, let''s say I want to get the document http://www.somewhere.com/readme.txt How would I read the file from the Internet and write it to a local file? Thx in advance. My Geekcode: "GCS d s: a14 C++$ P+(++) L+ E-- W+++$ K- w++(+++) O---- M-- Y-- PGP- t X R- tv+ b++ DI+(+++) D- G e* h!" Decode my geekcode! Geekcode.com
Visit our web site: Asylum Entertainment
DisKordCoder
DisKordCoder
A good idea would be to goto the page you want the source for.

Goto the View menu on IE, and select Source.

Any help?

Also, if the page uses frames, click right mouse button on thr page and select View Source
ziplux
ziplux
I could do that, but I want to automate it. I''m writing a program that grabs a news page and transfers it to my graphing calculator so I can read it. I''m going to strip the HTML away in C++ and then convert the file to a special format, then send it to my calc. But I need to know how to get a file from a HTTP server.


My Geekcode: "GCS d s: a14 C++$ P+(++) L+ E-- W+++$ K- w++(+++) O---- M-- Y-- PGP- t X
R- tv+ b++ DI+(+++) D- G e* h!"
Decode my geekcode!
Geekcode.com


Visit our web site:
Asylum Entertainment
Yanroy
Yanroy
There is a tutorial about sockets here on gamedev that I found while looking into neural networks... I think if you do a search for "neural net" it will come up close to the bottom. I think it is called something like "building your own internet" (maybe not). One of the example programs grabs an HTML file from some website (microsoft.com?).

What kind of calculator are you going to do this with? If you aren''t using TI products... you should be My personal favorite is the TI-89.

PS - how is extreme tic-tac-toe coming along? Did you rewrite the particle system to use a linked list?

--------------------


You are not a real programmer until you end all your sentences with semicolons; (c) 2000 ROAD Programming


You are unique. Just like everybody else.

Yanroy@usa.com

Visit the ROAD Programming Website for more programming help.

--------------------

You are not a real programmer until you end all your sentences with semicolons; (c) 2000 ROAD Programming
You are unique. Just like everybody else.
"Mechanical engineers design weapons; civil engineers design targets."
"Sensitivity is adjustable, so you can set it to detect elephants and other small creatures." -- Product Description for a vibration sensor
goir
goir
1. Get the IP of www.somewhere.com
2. Make a TCP connection to it on port 80
3. Send a message looking like this:
"GET /readme.txt HTTP/1.0\r\n\r\n"

4. Hope the server returns your document


I don''t have times to post any code right now.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.