Tuesday, July 28, 2009

C# .NET troubleshoot?

i am required to put a timer sort of thing in my application, such that the applocation can not run till 5 days after it is once run. and again after 5 days it can be executed.





the thought of troubleshoot are:


1. we can store its date somewhere and on trying to run the application we can check that against the system date (but there is loophole here :: what if the user modifies his date to 5 days later??)


2. we can encrypt the date and store it in the directory somewhere then put a sort of countdown there and check if 5 days have passed.


and how can this be done?? any ideas?





are there any other solutions to this problem?





if yes.. looking forward for it :-D


thanks in advance

C# .NET troubleshoot?
don't use the system clock b/c of the loophole you mention in point #1.





instead, ping a webservice that returns the datetime (check http://tf.nist.gov/service/time-servers.... for various US gorvenment time servers).





yes, then encrypt it and store it in a config file where the application is run. .Net 2.0 has built-in support for editable config files, whereas 1.1 had read-only config support.

gerbera

No comments:

Post a Comment