c# 软件有效期限制_c#程序设定使用期限_如何在C#windows应用程序中使用过期日期。...

51663

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[^]

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值