some question about login window

Please support our C# advertiser: Intel Parallel Studio Home
Thread Solved

Join Date: Dec 2008
Posts: 9
Reputation: SerogaM is an unknown quantity at this point 
Solved Threads: 0
SerogaM SerogaM is offline Offline
Newbie Poster

some question about login window

 
0
  #1
Dec 28th, 2008
I build Log in window where user enter his usernmae and password
I still don"t want use SQL and any data keeper, it's only for two users
so I check the password and username if it' ok than user must press botton OK and load next window this step I can't over .
Are the any suggestions ???

Sergey
Reply With Quote Quick reply to this message  
Join Date: Aug 2006
Posts: 2,065
Reputation: Ramy Mahrous is just really nice Ramy Mahrous is just really nice Ramy Mahrous is just really nice Ramy Mahrous is just really nice 
Solved Threads: 256
Featured Poster
Ramy Mahrous's Avatar
Ramy Mahrous Ramy Mahrous is offline Offline
Postaholic

Re: some question about login window

 
0
  #2
Dec 28th, 2008
mmmm, just take a look
  1. bool Validate(string username, string password)
  2. {
  3. //you're code
  4. }
  5. //button login event handler
  6. void onClick_btnLogin(object sender, EventArgs e)
  7. {
  8. if(Validate(txtUserName.Text, txtPassword.Text))
  9. {
  10. Form2 form2 = new Form2().Show();
  11. this.Hide(); //to hide login form
  12. }
  13. else
  14. {
  15. //invalid username or password
  16. }
  17. }
BI Developer | LINKdotNET
B.Sc Computer Science, Helwan University
Technical blog | http://ramymahrous.wordpress.com
LinkedIn | http://www.linkedin.com/in/ramymahrous
Reply With Quote Quick reply to this message  
Join Date: Oct 2008
Posts: 1,923
Reputation: ddanbe has much to be proud of ddanbe has much to be proud of ddanbe has much to be proud of ddanbe has much to be proud of ddanbe has much to be proud of ddanbe has much to be proud of ddanbe has much to be proud of ddanbe has much to be proud of ddanbe has much to be proud of 
Solved Threads: 276
ddanbe's Avatar
ddanbe ddanbe is offline Offline
Posting Virtuoso

Re: some question about login window

 
0
  #3
Dec 28th, 2008
So you hard code your passwords and usernames into your program, this is not very a good idea.
>>and load next window this step I can't over
I think you mean you cannot switch between the login window and the next. Well close the login form and open the main form.
A way to do this is open both forms but call form.Hide() on the main form. Then switch between form.Show() and form.Hide().
Today is a gift, that's why it is called "The Present".
Make love, no war. Cave ab homine unius libri.
Danny
Reply With Quote Quick reply to this message  
Join Date: Dec 2008
Posts: 9
Reputation: SerogaM is an unknown quantity at this point 
Solved Threads: 0
SerogaM SerogaM is offline Offline
Newbie Poster

Re: some question about login window

 
0
  #4
Dec 28th, 2008
thanks Ramy and ddanbe your both answer my question
Sergey
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the C# Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC