Everyone knows what a login system is ! so i don't think any explanations are needed . i will come to the main thing , Today we are going to make a simple login system in c# .
You need two text boxes,two labels and two buttons.
Now make the controls look like this on form.
Now let's go for login button codes
You need two text boxes,two labels and two buttons.
Now make the controls look like this on form.
Now let's go for login button codes
//if textbox1 text is admin and textbox2 text is 1234567 if ((textBox1.Text == "admin") && (textBox2.Text == "1234567")) { //then show form2 Form2 nextform = new Form2(); nextform.ShowDialog(); } else { //if username and password is incorrect show this message box MessageBox.Show("Username or Password Invalid"); }This is the code for button 2 which is a exit button
Application.Exit();Alright we are done ! I hope this is helpful !
4 comments
How can We change the shape of the Button?
ReplyI want to make the textbox, buttons etc edges more rounded...
Can you help me with this?
#http://ultimateprogrammingtutorials.blogspot.com/2013/07/how-to-make-round-button-in-c.html#
ReplySekolah Blogger Indonesia
ReplySekolah Adsense
Sekolah Wordpress
Sekolah Blogger
Sekolah Hosting
Sekolah SEO
Forum Anime Indonesia sa564768789044444
Learn Csharp Programming with Examples
ReplyPost a Comment
Note: Only a member of this blog may post a comment.