如何在webapp中给出有效期 [英] how to give expiry date in webapp

查看:115
本文介绍了如何在webapp中给出有效期的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在Web应用程序中给出用户帐户的到期日期...

how to give expiry date of user account in web application...

推荐答案

对于useraccount的到期日期,您可以考虑以下任一个

a)在数据库中为用户标记一个过期日期字段,在页面加载时读取相同的过期日期,如果用户帐户已过期,则让页面加载或重定向到上一页/登录页面.
b)您可以使用会话,您可以在其中将代码用于session.expire(time).

更好的解决方案是从数据库读取数据,但是如果您对数据库没有足够的权限并且如果您无法更改数据库设计,请进行会话.

希望ans给您正确的方向.

谢谢
Amit
For the expiry date of useraccount you can think of either of these following

a) mark a expiry date field in database for the user, read the same expiry date on page load and either let the page load or redirect to previous page/ login page if the user account has expired expire.
b) you can use session where you can use code for session.expire(time).

better solution is to read data from database but in case you do not have enough rights on database and if u cannot change the database design go for session.

Hope the ans will give u a right direction.

thanks
Amit


您需要为网页设置会话超时.
有关会话的更多信息,请浏览
http://msdn.microsoft.com/en-us/library/ms178581.aspx [ ^ ]
http://msdn.microsoft.com/en-us/library/ms972429.aspx [ ^ ]
ASP.NET会话管理内部 [
You need to set a session timeout for a web page.
For more information on sessions, go through
http://msdn.microsoft.com/en-us/library/ms178581.aspx[^]
http://msdn.microsoft.com/en-us/library/ms972429.aspx[^]
ASP.NET Session Management Internals[^]


这篇关于如何在webapp中给出有效期的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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