EDIT: Oops, this is C++. I though you wanted C# not C++/MFC, but I guess you want something on pure C++
Try searching for appropriate libraries. Search like "http request C++" or "http C++". I know they are some good libraries that I had used in the past, but don't remember any right now.
(Eh, will leave my original answer as well...)
Here is code I use:
which should work if by "hitcounter" you mean a counter that goes up everytime you visit a page.
HttpWebResponse res = null;
StreamReader stream = null;
string html = String.Empty;
HttpWebRequest req = (HttpWebRequest)HttpWebRequest.Create(nextLink);
req.Method = "GET";
req.ContentLength = 0;
res = (HttpWebResponse)req.GetResponse();
stream = new StreamReader(res.GetResponseStream(), Encoding.ASCII);
html = stream.ReadToEnd();
catch (Exception ex)
if (stream != null)
if (res != null)
This is on System.Net
Note that you don't need the stream = ... part since you don't care about reading anything. You need the response part though.
I also want to state that you should always think about the moral behind doing things like this. Dunno exactly what the deal is, but had to give my thoughts.