Visual Basic Tutorial - Create a Simple Login Form [Voice Tutorial]

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
what if I want Teja here and this is my first visual basic tutorial and in this tutorial I'll be teaching you how to create a simple login program and visual basics now I'll be using Visual Studio 2010 Express in this video so yes this works with all the other versions of Visual Basic as well now if you're wondering why I am not uploading videos regularly then I have to tell you if you don't know yet I posted it on my Facebook page am I'm actually creating a new software keylogger so I'm busy with that work and due to which I am NOT able to upload any videos and also that's not only that's not only the reason I'm busy with my college work and all well anyway let's get started so as you say as I told you I'm using visual basic 2010 Express okay so now let me create a new project and let me call it login program here we go and now let me add two labels here and let's keep the taste of texture of this as username and let's add another similar label and let's set this text to password and yeah now we are creating the registration window so that the user can actually create a username and password before he can log in with his credentials so using this we are creating I mean in this form we are actually creating the register program register form okay so let's add two text boxes and also make sure that you make this text box multi-line so that you can place it I mean you can adjust it to whatever size you want let me add two text boxes and let me call the first text box as user name text box let me give its name as user name username field okay sorry field and let's call the second text box as password field okay now let's add a button so that the user can click on it after you he enter his username and password and here we go this is the button and let's give its text - let's change its text to register or simply save okay now we are all done with the design of this form and yeah let's change the name of this form to register and as you can see the name of the form has been changed here okay now let's go to project and then to login program properties now you'll see the name of your program over here followed by property so you gotta click on that and this will open something like this now you gotta go to settings and over here you got to create two new settings the first one call it as username and give its type to string and leave this empty and then create a second one and name it as password and give its type to string as well because we're not returning a stole some a string value there and leave the value empty now we have successfully created two two new settings username and password now let's go back to our form 1 and let's code this Save button just double click on the Save button and yeah now when the user clicks on the Save button his credential so I mean his username and password should be saved for this program and yeah now we're gonna do that we're gonna learn how to do that ok so ok let's go and double click on the Save button and we got to make sure that the not that none of the username text field or the password text field are empty so only if they are not empty then we can save the username and password so to do that you gotta give a if statement you gotta say if not username field dot text the username field is actually the username text box the text box which we have created earlier is equal to empty and not okay so okay let's say this and let's declare a variable dim a as integer for what to do it equal to zero okay and if not user name field or text equal to empty then we gotta we gotta give the value of a equal to a plus one or you can just say a plus equal to one and we also go to check whether the password field is empty or not so we got to give another if statement we got to say if not password field dot txt equal to empty then we gotta say a plus equal to one and you can do it in other way as well like you can combine these both if statements you can say if not username fill the text and pass a field or text is empty then you can directly give the rest of the code there but this is a logical way to do it so I'm gonna I declared a very variable a as in here and I'm gonna increment its value only if the username text field is not empty and the password text field is not empty so if both the user name text field and the password text field are not empty then the value of a will be two so if you see here the initial value of a is zero and if the user name text field contains some text then the value of a is going to be incremented by one which means that value of a will be one and the next thing is it checks the password text field and if the password text will contain some and it's not empty then the value of a is going to be incremented by another one and the value of goal a is going to be two now so we gotta give another if statement here we gotta say if a equal to two then we gotta say my dot settings dot username equal to username field dot txt and my dot settings dot password equal to password field dot txt and then my dot settings dot save what we did here is so as I told you if a is equal to two then none of the username none of the two text boxes that is the username text field and the password text field are empty so in that case we are going to save the credentials so what it is I I called my out settings dot username I assign the value of my dog sitting start username with the text present in a username text field which means the user name is not saved in the username username settings which we have created earlier and the same is the case with the password and after I gave these two statements I gave the third statement my dot setting starts a which is going to save the the two above statements that is the username field and password field so your the credentials are not going to be saved permanently for that computer or for that user let's say so we are all done with the register window now let's create our login window let's go add a new windows form and let's okay let's leave it as form 2 dot vb let's click on add so here is our new form and as we did before let's add two labels I got the exchange is a bit ok all right let's add two labels and let's change the text off first label to username and let's add a similar other label and let's change the text of this one to password okay let's add text boxes now let's make this multi line and let's adjust them so that it looks good not messy so we have two text fields now now let's add a button so that the user can click on this button to login and here we go let's change the text to login so we are all done with the design of the login window now now we gotta go to the coding part and give it some code so that the user can only be logged in or if he enters a exact username and password well okay let's go to the login form let's go to the login button let's double click on the login button and here we go and yeah as I did before let's do the same logic we gotta declare div a as integer and in the button for the button one you got a bigger code something like this so we gotta say if one one more thing is you gotta give it to 0 of course if you don't give the value if you don't initialize the value of a to 0 it default Lee gets the value of 0 because it's an integer so anyway ok let's come to the button 1 that is the login button and let's code like yes yeah for what to change the names of these text fields let's change the name of these text fields let's change this user name text field and let's change the second text box name to password text field okay okay let's go to the login button and now let's code it we have to say if username text field dot text equal to my dot setting start username then we gotta say a plus equal to one and let's give another if statement to test the password text field enough so let's say if password text field dot text equal to my dot Settings dot password then we got increment the value of a by one just like this just like as we did in the register window we are using the same logic there and so if both the username and the password are correct then the value of a will be two so now it's easy for us to code the rest of the code we can simply say if a equal to two then let's display a message or saying that login is successful we can say login successful else we can display that either either the password or username is not valid and let's say this as msgbox dot exclamation and this one has a mystery box that information perfect now that's it now let's run the program I'll click on the start debugging button you can directly tap on the f5 key and here is the register window and yeah let me enter let me create our credentials let me say deja and let me give the password as test pass and let me click on Save button so now actually the username and password are saved but I didn't give any other go to the Save button so it seems that nothing that nothing happened so let's go back so let's go back and let's code the register window let's code the Save button and we can also say after this we can say we can display a message saying that register successful and yeah we can say that we can actually open forum - that is the login form now ok now let's run the program and here is the register window and let me give default like like some test values Dasia and test pass save and here we go it says register successful and as soon as you click on ok the form 2 gets opened up in the window and if you enter the same same values which which we you have end earlier then you can see it says login successful if you enter a wrong password like if you enter a wrong password and click on the login button it says that that either the password or username field username is not valid okay one more thing is we can change the password character like just select the password text field go down scroll down and here in the password car you can give an ass trick or a bullet symbol you can hold alt on 7 on your keyboard and then a bullet symbol guests appears on your screen and you can do the same with the register window you can change the password character to the bullet symbol and yeah we are done okay now let's change the properties let's go to the application tab application tab and let's set the start up form as formed too so that whenever the user opens the program the font to which is the login form appears on the screen so in the login form let's add something which is needed actually if the user has not yet registered with this program he should have an option to register so let's add a link label and let's call this register and when if the user clicks on this thing then we got to show the form one and perfect and we can actually hide this form sorry oops okay here we go so let's run the program and here we go this is the login window and yeah if we click on the register label here the register button the register form opens up and you can create a username like let me say tech garage and let me call the password as test pass and let's click on the Save button and it says register successful and once you click on OK the password I mean the login form appears and if you enter the same values as you entered before if you enter the exact credentials then just look it says login successful and so this is how you can actually create a login program in Visual Basic and also keep in mind that once the user creates our credentials creates is his or credentials they will be saved on his computer on his computer permanently so just keep this in mind and yes that's all I wanted to teach you in this video tutorial if you want any more explanation or if you have any doubts regarding this video feel free to comment below in the comment section I'll try to help every one of you who comment below and you can also email me at Anonymous hacker 156 at the wades email comm for any tech queries I will surely help you just leave an email okay yeah thanks for watching hit the subscribe button for more videos like my Facebook page facebook.com slash tech call one five six follow me on twitter at twitter.com/usembassymanila
Info
Channel: Tech Raj
Views: 179,146
Rating: undefined out of 5
Keywords: visual basic how to make a login, visual basic 2010 how to make simple login and register system, how to make a program in visual basic, how to create a login form in visual studio 2010, how to create a login form in visual basic, how to create a login form in visual studio 2012, creating a program in visual studio, how to create a program in visual studio 2010, visual basic tutorial, login program in visual basic, visual basic simple program
Id: WDp5EDkKg-E
Channel Id: undefined
Length: 19min 17sec (1157 seconds)
Published: Sun Jul 03 2016
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.