locked
Getting the Exact time difference RRS feed

  • Question

  • Hello Everyone,

    I am installing my c# windows application on one of the server. I need to run this application in evaluation mode for 10 days. Now i would like to make my application not to run after 10 days even if the user changes the System time with back date. I dont want anyone to use my application more than 10 days.

    Can anyone please let me know how to do this?

    Thanks

    Anil Kumar

    Monday, December 20, 2010 1:06 PM

Answers

  • I would suggest storing an encrypted expiration datetime value in the registry.
    Kev Ritchie
    Follow me on Twitter
    Check out my blog
    • Proposed as answer by Jesse HouwingMVP Monday, December 20, 2010 1:40 PM
    • Marked as answer by Cookie Luo Monday, December 27, 2010 3:22 AM
    Monday, December 20, 2010 1:16 PM
  • You'll need to connect to the internet, or use some other external means to check the time.

    You could also store the date and time each time your application starts and exits. and ensure it's later than the previous time, that would make it harder to hack...

    • Proposed as answer by Jesse HouwingMVP Monday, December 20, 2010 1:40 PM
    • Marked as answer by Cookie Luo Monday, December 27, 2010 3:22 AM
    Monday, December 20, 2010 1:27 PM

All replies

  • I would suggest storing an encrypted expiration datetime value in the registry.
    Kev Ritchie
    Follow me on Twitter
    Check out my blog
    • Proposed as answer by Jesse HouwingMVP Monday, December 20, 2010 1:40 PM
    • Marked as answer by Cookie Luo Monday, December 27, 2010 3:22 AM
    Monday, December 20, 2010 1:16 PM
  • even if you store in registry, if the user changes the system time, how to get the exact elapsed time??
    Monday, December 20, 2010 1:26 PM
  • You'll need to connect to the internet, or use some other external means to check the time.

    You could also store the date and time each time your application starts and exits. and ensure it's later than the previous time, that would make it harder to hack...

    • Proposed as answer by Jesse HouwingMVP Monday, December 20, 2010 1:40 PM
    • Marked as answer by Cookie Luo Monday, December 27, 2010 3:22 AM
    Monday, December 20, 2010 1:27 PM
  • mine is intranet application. Users wont be having a internet connection.that is where i was stuck....whatever the way you suggested will work only 20%.still user can hack the time setting
    Monday, December 20, 2010 3:01 PM
  • Hi Anil,

    Using my answer and Jesse's second suggestion would work.  This would stop users accessing your application if the computer date was set back to a previous date/time.


    Kev Ritchie
    Follow me on Twitter
    Check out my blog
    Monday, December 20, 2010 3:05 PM