c#程序设定使用期限_如何在C#windows应用程序中使用过期日期。
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 afte
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[^]
魔乐社区(Modelers.cn) 是一个中立、公益的人工智能社区,提供人工智能工具、模型、数据的托管、展示与应用协同服务,为人工智能开发及爱好者搭建开放的学习交流平台。社区通过理事会方式运作,由全产业链共同建设、共同运营、共同享有,推动国产AI生态繁荣发展。
更多推荐


所有评论(0)