如何在C#中创建动态日历?就像系统日历一样 [英] How to create a dynamic calendar in C#? Just like system calendar

查看:291
本文介绍了如何在C#中创建动态日历?就像系统日历一样的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

I am creating trail version of my Application I give 2 months trial period for my App but when the user change the system time trial period is updated to prevent this problem I want to create my own calendar and use it is date if you have any solution to my problem please............ help me.
Note: if you have any other solution to solve my problem please help me

thanks advance!





我的尝试:





What I have tried:

DateTime todayDate = DateTime.Now;
DateTime after3MonthDate = todayDate.AddMonths(3);
//Set First Day of Month
after3MonthDate = new DateTime(after3MonthDate.Year, after3MonthDate.Month, 1);

推荐答案

解决方案:您可以在互联网上查看日期时间,而不是在系统中查看时间。



请参考此处的解决方案https://nickstips.wordpress.com/2010/02/12/c-get-nist-internet-time /
Solution: You can check date time in internet instead of time check in System.

Please refer the solution here https://nickstips.wordpress.com/2010/02/12/c-get-nist-internet-time/


如果你想这样做,你需要在你的应用程序第一次启动时保存日期。

如果现在 - 3个月更大试用期结束于此日期。

所以:

- 如果您的应用程序启动,请查看您要保存日期的文件(可能还有其他设置)已存在

- >如果没有将当前日期保存到此文件中 - 所以现在它存在

- >如果是,则进行计算

- >根据结果​​进行下一步(启动应用程序 - 或 - 显示消息并完成应用程序)
If you want to do this you need to save the Date when your Application startet 1st time.
If Now - 3 Months is greater than this date the trial-period is over.
So :
- if your Application starts look if the file where you want to save the Date (and perhaps other Settings) is existing
-> if not save the current date into this file - so now it exists
-> if Yes then do the calculation
-> depending on the result do the next (Start Application - OR - Show Message and finish the Application)


这篇关于如何在C#中创建动态日历?就像系统日历一样的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆