Ok i am makeing a program and want it to check if there is an update availible by checking if a txt file with the version has a difrent number.

I have been looking around and found absolutly no help for this problem. The text file would be at a loaction like Http://www.mysite.com/check/check.txt if it makes it any easyier it could just be a webpage containing it like, Http://www.mysite.com/check/check.html, I have complete controll over the website so if a diffrent file type is need just say and i can put it on.

So my questions are is this posible in c++?, if yes how?, or what other way can this be accomplished?

Anyhelp is appreicated, and thanks for the help in advance.

7 Years
Discussion Span
Last Post by pseudorandom21

It can be done but it's usually not easy, nor is it intuitive. I have "scraped" a website with C++, which means downloading a copy of the web page's HTML.

For your particular problem, wouldn't ftp be easier to use than HTTP ?

Scraping is a bad way to do it, but I did it...
with HTTP you'll connect to www.mysite.com then send a request for the page you want, it may look something along the lines of (but probably not exactly) this:
GET /check/check.txt

Anyway, unless you want to use some libraries for HTTP automation/stuff then you will be reading a lot of HTTP specification, and most of it doesn't tell you what you need to know.

That said, I highly recommend not scraping the web page. I haven't used FTP but I have written an SMTP client, and a POP client, and it is my thinking FTP is quite do-able. You may want to use a third party library for FTP also.

There are thousands of libraries for C++ (lucky us). Also, using a library will most likely save you a lot of time.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.