Why not use a language and toolset suited to the task?GhostXoPCorp wrote:i want my program to read just a line of information from a cite, for example a "daily update" and just have my program copy that information like this
http://www.examplesite.com
webpage:
Daily Update: First Day Of Program Release
end of webpage
thats all the site willl display
how can i get my C++ win32 program to read that line from that site?
C++ reading info from a webpage
Re: C++ reading info from a webpage
Re: C++ reading info from a webpage
On Windows, it doesn't get much simpler than using the InternetOpen, InternetOpenUrl and InternetReadFile functions. It basically takes care of everything for you.
Re: C++ reading info from a webpage
Absolutely +1 to Gigasoft. Nothing beats somebody actually answering the question (how to do it in C++ using Windows API).
Every good solution is obvious once you've found it.
- Owen
- Member
- Posts: 1700
- Joined: Fri Jun 13, 2008 3:21 pm
- Location: Cambridge, United Kingdom
- Contact:
Re: C++ reading info from a webpage
Not the case, though I understand that the wording of the relevant man pages can be ambiguous.Gigasoft wrote:Send won't return until it has sent everything or it fails, unless the socket is set to non-blocking mode. Recv, however, may return less data than requested.
So, indeed send will wait for buffer space to be available. However, for TCP it doesn't guarantee that the whole buffer you pass to send will be sent in one go. You must check the return value and manually ensure this.If space is not available at the sending socket to hold the message to be transmitted, and the socket file descriptor does not have O_NONBLOCK set, send() shall block until space is available. If space is not available at the sending socket to hold the message to be transmitted, and the socket file descriptor does have O_NONBLOCK set, send() shall fail. The select() and poll() functions can be used to determine when it is possible to send more data. [SUS3]