Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Syncronise the system Date through c# code

Syncronise the system Date through c# code

Scheduled Pinned Locked Moved C#
helpcsharp
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    sandeep kumar pundhir
    wrote on last edited by
    #1

    Hi All, I have to syncronise the system Date through c# code. The scenerio is like whenever User sign In, I have to check the current system date,and compare with the date i have written in Registery, so that he can not use the appication beyond the trial period date. The Problem is that the User can Manipulate his system date and can sign in n number of times. If anyone have the code then Please help me out in my problem. Thanx Sandeep

    D V 2 Replies Last reply
    0
    • S sandeep kumar pundhir

      Hi All, I have to syncronise the system Date through c# code. The scenerio is like whenever User sign In, I have to check the current system date,and compare with the date i have written in Registery, so that he can not use the appication beyond the trial period date. The Problem is that the User can Manipulate his system date and can sign in n number of times. If anyone have the code then Please help me out in my problem. Thanx Sandeep

      D Offline
      D Offline
      Dave Kreskowiak
      wrote on last edited by
      #2

      Sychronize the system date/time with what?

      A guide to posting questions on CodeProject[^]
      Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
           2006, 2007

      1 Reply Last reply
      0
      • S sandeep kumar pundhir

        Hi All, I have to syncronise the system Date through c# code. The scenerio is like whenever User sign In, I have to check the current system date,and compare with the date i have written in Registery, so that he can not use the appication beyond the trial period date. The Problem is that the User can Manipulate his system date and can sign in n number of times. If anyone have the code then Please help me out in my problem. Thanx Sandeep

        V Offline
        V Offline
        Vikram A Punathambekar
        wrote on last edited by
        #3

        In addition to the constraint you've applied, add another flag in the registry, which tells you if the product has expired or not. Initially, it should be false, but after the first time the user has used the product for more than X days, make it false. After this, even if the user manipulates the system time, the second condition will fail. Possibly better way to do it: I While installing, set lastUsedDate to the current date and usedDaysCount to 0 in the registry. II Every subsequent execution

        1. Compare current date with lastUsed date in registry.
        2. If they are different
        lastUsedDate = current date;
        usedDaysCount++;
        3. If usedDaysCount > 10
        Display nag screen and exit
        Else
        Get on with the program.

        Cheers, Vıkram.


        Déjà moo - The feeling that you've seen this bull before. Join the CP group at NationStates. Password: byalmightybob

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups