Dear friends,
I have Developed a Windows application using C# code. Now I need to apply Expiry date, that means I need to create trial version for the 1st time user, and The application must close after the expire date.
Please anyone help me for this problem.
Thanks in Advance.
解决方案If you know the expiration date in the application, one idea is to implement a logic like the next one.
In your main form Load event first hide the main form (by using this.Hide()), then check the current date (by using DateTime.Now property) and compare it with the expiration date (by using DateTime.CompareTo() method); There are 2 possibilities:
1.If the current date is higher then the expiration date you could notify the user about this (by using MessageBox.Show() method) then close the application (by using this.Close()).
2.Otherwise show the current form (by using this.Show() method).
sir please see the below link which contains a working expiry date application
Application Trial Maker[^]