Eline Sami

Eline Sami

  • NA
  • 47
  • 70.4k

Time Stampt Function(trial version)Windows form application

Jun 10 2014 2:58 AM

Hi,

I implemented a timestamp function to compare the current Date/time with the expiry date, but the function creates a text file and stored in in the isolated storage file. This doesn’t really look good and secure. I don’t need to create any text file that can be easily tracked and deleted. Also, I don’t want to write to registries. Therefore, I started to modify the code and I’ve done the following, but cannot proceed. I don’t want to run my application if it is already expired. Also I need to display a message and force the application to exit. So what is missing in my method? I call it in the Main() Method but what to write as if condition to switch it on /off?

 public void timeStamp()
 {
 DateTime ExpDate = new DateTime(2015, 01, 01);
 if (DateTime.Today >= ExpDate)
 {
 Console.WriteLine("Trial version has expired. Please contact us to get the new version");
 return;
 }
 }

Answers (1)