会员资格和授权 [英] Membership And Authorization

查看:68
本文介绍了会员资格和授权的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何:在记录上创建日期限制?

how to:creating date limitation on logging?

推荐答案

假设您知道一般如何进行授权,而您的问题只是时间,这就是答案:使用类型System.DateTime.您可以使用静态方法System.DateTime.NowSystem.DateTime.UtcNow(在您的应用程序服务于多个时区时很好)来获取当前时间.为了进行比较,只需使用运算符"==",!=",<",>",< ="和> =".对于您的所有目的,这应该足够了.

请参阅 http://msdn.microsoft.com/en-us/library/system.datetime.aspx [^ ] .

—SA
Assuming you know how to do authorization in general and your problem is only the timing, here is the answer: use the type System.DateTime. You can get current time using the static method System.DateTime.Now or System.DateTime.UtcNow (which is good when your application serves multiple time zones). For comparison, simply use operators "==", "!=", "<", ">", "<=" and ">=". That should be enough for all your purposes.

See http://msdn.microsoft.com/en-us/library/system.datetime.aspx[^].

—SA


这篇关于会员资格和授权的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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