我只想登录表单的特定时间段 [英] I want login form only particular time period
问题描述
申请登录表格..
用户名:TextBox
密码:TextBox
登录(按钮)
i只想在特定的时间段内登录此表格..这意味着它的开放时间仅为上午10:00 Am - 10:30 Am。 ..使用Asp.Net
请朋友帮助我
我尝试过:
申请登入表格..
用户名:TextBox
密码:TextBox
登录(按钮)
i想要只登录此表单的特定时间段..这意味着它只打开
10:00 Am - 10:30 Am ...使用Asp.Net
在登录按钮单击事件,检查DateTime.Now
并做任何你想做的事。
登录按钮点击活动
获取当前时间
然后在10:00 Am - 10:30 Am检查此时间>
如果为真则转到认证其他显示用户友好消息。
喜欢:
TimeSpan start = new TimeSpan( 10 , 0 , 0 ); // 10点
TimeSpan end = new TimeSpan( 10 , 30 , 0 跨度>); // 10:30
TimeSpan now = DateTime.Now.TimeOfDay;
if ((现在> start)&&(now < end))
{
// 找到匹配
AuthenticateUser();
}
其他
{
// < span class =code-comment>找不到匹配
}
Application Login Form..
User Name :TextBox
Password : TextBox
Login(Button)
i want login this form only particular time period ..it means its open's only
10:00 Am - 10:30 Am...using Asp.Net
please friend's Help Me
What I have tried:
Application Login Form..
User Name :TextBox
Password : TextBox
Login(Button)
i want login this form only particular time period ..it means its open's only
10:00 Am - 10:30 Am...using Asp.Net解决方案In Login Button Click Event, check theDateTime.Now
and do whatever you want to do.
on login button click event
Get current time
Then check this time between 10:00 Am - 10:30 Am
if true then go to authentication else show user friendly message.
Like :
TimeSpan start = new TimeSpan(10, 0, 0); //10 o'clock TimeSpan end = new TimeSpan(10, 30, 0); //10:30 o'clock TimeSpan now = DateTime.Now.TimeOfDay; if ((now > start) && (now < end)) { //match found AuthenticateUser(); } else { //not match found }
这篇关于我只想登录表单的特定时间段的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!