c# - Using DateTime to terminate application? -


i'm curious pros , cons of following code terminate application running after date in time.

datetime expire = new datetime(2014, 2, 20);  if (datetime.now > expire)             {                 messagebox.show("this software's license has expired!");                 this.close();             } 

i'm considering using in small beta software i've written wonder if fool proof or can datetime class "tampered" setting clock on system? i'm not entirely sure if datetime relies on ever os system thinks time or not.

yes, datetime.now report current system time, , can affected user changing clock.

if wants continue using application after license has expired, can pretty easy crack kind of technique anyway. not mean type of approach has no value you.

there's plenty of discussion on around type of idea:

to save time here's couple of top tips:

  • if people willing crack app or reset system clock avoid paying license, it's not worth time try , stop them, , minimal check in question it's worth doing.
  • rather disabling app when license has expired, maybe disable features instead, app remains advert full one.

Comments

Popular posts from this blog

python - Subclassed QStyledItemDelegate ignores Stylesheet -

java - HttpClient 3.1 Connection pooling vs HttpClient 4.3.2 -

SQL: Divide the sum of values in one table with the count of rows in another -