Click here to Skip to main content
15,906,816 members
Please Sign up or sign in to vote.
3.00/5 (1 vote)
See more:
Hi. This maybe a simple question or complicated im not sure at all. Basically I have made an application that requires a login to be entered when the program is run. Every user needs to have there own unique "Space" with there saved details from previous times they have logged in and used the program.

I simply can't get my head around how this would work. Obviously atm if a person logs in they get into the program and have all the functionality of the program but of corse its not there unique space it would just show them the program that everyone else sees.

If any one can could someone please explain to me roughly how this works and point me to a tutorial or show me some sort of example of how this works.

Thank you for any replies it is much appreciated.
Posted
Comments
BobJanova 13-Jun-11 7:35am    
Is this for a web app or a desktop (WinForms/WPF) app?

1 solution

When you log in, your userID is saved, and only information relevant to that user is pulled (normally from a database) and displayed. The basic form is the same for all users, it is just the detail that is specific.
For example. If you create an application which has a form and in the load event you let them log in via a dialog:
frmLogin log = new frmLogin();
if (log.ShowDialog == DialogResult.OK)
   {
   if (log.UserName == "The Boss")
      {
      labGreeting = "Hello Boss! Shall we go down the pub, or actually do some work?";
      }
   else
      {
      labGreeting = string.Format("Hello {0}! Welcome back!",log.UserName);
      }
   }
else
   {
   Close();
   }
Then if you log in with the name "Fred", or "Joe" you would see a personalised message, but "The Boss" would get a completely different screen.

You need to get yourself a book, and study it - there is way too much to explain in a simple answer!
 
Share this answer
 
Comments
DanHodgson88 13-Jun-11 7:12am    
Yeah I know its a massive subject and I need to do some major research and reading into this is there any books you would suggest are a good read? Thanks for the reply :)
OriginalGriff 13-Jun-11 7:18am    
Sorry - it's been so long since I read anything that level that I can't even remember what books I used! :laugh:
Try anything basic on databases - they should have something on user handling.
DanHodgson88 13-Jun-11 7:19am    
Cheers appreciate your time anyway bud

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