Click here to Skip to main content
15,886,362 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
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
Posted
Updated 25-Apr-16 0:46am
Comments
Sergey Alexandrovich Kryukov 25-Apr-16 9:38am    
You cannot do this by one simple reason: there is no such thing as "open a form". :-)
Bad idea, overall.
—SA

In Login Button Click Event, check the DateTime.Now and do whatever you want to do.
 
Share this answer
 
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 :

C#
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
}
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900