CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Sep 2010
    Posts
    6

    Arrow Get Website Content As A String

    hey,

    so im making a program, and i want to make it so the program only works till a sertain date, but the problem that im having is that im geting the date from the computer, and if the user changes the date backwards a few days, then he/she will have access to the program again
    here is a part of my code..
    Code:
    SYSTEMTIME date;
    GetSystemTime(&date);
    if((date.wYear==2010)&&(date.wMonth==9)&&(date.wDay<30))
    {
        // do program stuff
    }
    else 
    {
        // will not do program stuff
        // will do other stuff i want it to
    }
    my question is How do i get the date from the internet so that the user cant just be able to use the program by changing the date a few days back ..
    here is a webpage that i made that generates the date within it >>>>> date.mygamesonline.org
    and what im trying to do is grab the site content as a string.. or any other way and be able to compaire it ..

  2. #2
    Join Date
    Apr 2000
    Location
    Belgium (Europe)
    Posts
    4,626

    Re: Get Website Content As A String

    Check out the WinInet series of functions.
    If you use MFC: check out the classes CInternetConnection, CInternetSession and CInternetSession::OpenURL() in specific.

    Note that is VERY easy to detour a request to download a page to somewhere else. So you probably want to make something a little more elaborate than just grabbing the page off a site.

    You typically want your client to generate a random 'key'. Request a page and provide the key to the remote site, the website then uses the data, combines this somehow with the key and returns this value. Your client can then check if it has a valid date AND if that date wasn't somehow faked.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured