Advertisement

Fstream and HTTP

Started by March 11, 2003 12:46 PM
1 comment, last by zackriggle 21 years, 11 months ago
Is it possible for me to do the following: ifstream fin; fin.open("http://some_site.com/somefile.txt"); char buffer[2048]; fin.getline(buffer,2047); and have ~2 KB of the web page stored in "buffer"? If not, don''t give me an explanation of HOW to do it, please, I just want to know if it would work. Thank you. ================== My (soon-to-be) Cherished Cookie of Appreciation: -- MattB - for WinSock advice --
No, fstreams support only the local filesystem. Add to that the fact that getline would only return the first line...

If I had my way, I''d have all of you shot!


codeka.com - Just click it.

Advertisement
You can create your own C++ HTTPStream class, though doing so is far from trivial.

If you are using C# and .NET you can use the WebRequest and WebResponse classes to accomplish what you are looking for.
[email=direwolf@digitalfiends.com]Dire Wolf[/email]
www.digitalfiends.com

This topic is closed to new replies.

Advertisement