如何在Asp.net中使用标签显示密码过期消息? [英] How to display a Password Expiry Message in Asp.net using label ?

查看:61
本文介绍了如何在Asp.net中使用标签显示密码过期消息?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在Asp.net中显示密码过期消息?
================================================== ===

我正在Asp.net,C#,SqlServer2005上工作.

在我的应用程序中使用的是发布日期"和到期日期"....可以正常工作.

因此,在用户登录到应用程序后...我需要使用Label显示一条消息.

您的密码将在2013年7月4日到期....剩余的天数是364"

登录到应用程序后,该消息应每天为每个用户显示.


请建议我该怎么做.

在此先感谢.

How to display a Password Expiry Message in Asp.net ?
=====================================================

Am working on Asp.net , C#, SqlServer2005.

in my Application am using Issue Date and Expiry Date....its working fine.

So, After User Login into application ...I need to display a message using Label.

"your password will be Expire on 04/july/2013....and left over days is 364"

This Message should show for every user DAILY after login into application.


Please suggest me how to do this.

Thanks in Advance.

推荐答案

嘿,乌拜德,

您尝试了什么,或者在哪里卡住了?似乎是一个简单的解决方案,所以我很好奇您到目前为止所做的一切?

您应该在数据库中查询到期日期.您可以使用时间跨度来计算总天数:

Hey Ubaid,

What have you tried, or where do you get stuck? Is seems to be a straight forward solution, so I''m curious how what you''ve done so far?

You should query the database for the expiration date. You can calculate the total amount of days using a timespan :

Timespan ts = DateTime.Now - expirationDate;
Console.WriteLine("Password expires in " + ts.TotalDays + " days");



如果仍然遇到问题,请更详细地描述您遇到的问题.这有助于我们指出正确的方向.

希望对您有帮助,
爱德华



If you still run into problems, please describe in more detail where you get stuck. This helps us to point to in the right direction.

Hope it helps,
Eduard




希望您在计算到期日期时没有任何问题.我从您的问题中了解到的是,您需要UI方面的帮助.

您可以使用 jQueryUI对话框在登录后显示弹出窗口.

如果您在计算到期日期时遇到问题,请按照Eduard(解决方案1)给出的说明进行操作.

谢谢
-Amit.
Hi,

hope you do not have any problem with calculating expire date. what i understand from your question is, you need help in UI.

you can use jQueryUI Dialog box to show popup after login.

and if you have problem with calculating expire date then follow instruction given by Eduard(Solution 1).

Thanks
-Amit.


这篇关于如何在Asp.net中使用标签显示密码过期消息?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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