Click here to Skip to main content
16,018,973 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
C#
I have 5 users to login my website.any one of this person going to login.that person is first person to login the website to.Notify that person you are the  first person today to login website.How to make this format in  asp.net c#.


What I have tried:

I have tried to make this now.
Posted
Updated 6-Aug-16 1:16am
Comments
Member 10992268 6-Aug-16 6:31am    
Question not clear
Raja Ganapathy 6-Aug-16 6:47am    
Hi,
Sorry for incorrect question i will explain my description clearly in describe problem tag.
Karthik_Mahalingam 6-Aug-16 7:01am    
are you using database?

1 solution

This can be done in many ways, this is the one of them

  • Create a Table with 2 columns LoginDate for date and UserName for storing userId
  • When an user logs in to the application just save the current date and his Id in the table.
    before saving the data, add a condition that,if a row is already present for today's date, if so then just ignore it and login to the application, he is not a first user.
  • if there is no row present for today , then insert a new row with todays' date and the UserID. Greet him the text as First login user, since he is the first user for today.

  • On every new insert, delete the old rows, if no audit required.


Take care of the coding part, come back if you need any help.
 
Share this answer
 
Comments
Raja Ganapathy 8-Aug-16 3:31am    
Hi! Karthik Thank you.
Sorry For late Reply
How to make this without using database bcoz if we add new columns to DB is not allowed our higher official. :)
Karthik_Mahalingam 8-Aug-16 4:26am    
ok fine.
then try using a notepad file.
Raja Ganapathy 8-Aug-16 4:46am    
Notepad File? means Please Explain clearly sir! store the login details in notepad?
Karthik_Mahalingam 8-Aug-16 4:51am    
No Raja,
The above logic in notepad file..
Wait for sometime, i will tell you..
Raja Ganapathy 8-Aug-16 4:52am    
Soon Sir Thank You. Waiting....

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