943,907 Members | Top Members by Rank

Ad:
  • C# Discussion Thread
  • Marked Solved
  • Views: 704
  • C# RSS
Dec 28th, 2008
0

some question about login window

Expand Post »
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
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
SerogaM is offline Offline
16 posts
since Dec 2008
Dec 28th, 2008
0

Re: some question about login window

mmmm, just take a look
c# Syntax (Toggle Plain Text)
  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. }
Featured Poster
Reputation Points: 480
Solved Threads: 276
Postaholic
Ramy Mahrous is offline Offline
2,189 posts
since Aug 2006
Dec 28th, 2008
0

Re: some question about login window

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().
Reputation Points: 2035
Solved Threads: 645
Senior Poster
ddanbe is offline Offline
3,740 posts
since Oct 2008
Dec 28th, 2008
0

Re: some question about login window

thanks Ramy and ddanbe your both answer my question
Sergey
Reputation Points: 10
Solved Threads: 0
Newbie Poster
SerogaM is offline Offline
16 posts
since Dec 2008

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C# Forum Timeline: Question about Dialog Box
Next Thread in C# Forum Timeline: file upload





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC