Search:

VB.NET Visual Basic Vb Show Case VB.NET Code Simple VB.NET Code

LEARN VB.NET 2008 L3 PASSWORD PROTECTED FORM 2 FORMS & IF

Free VB.NET Lessons
Free VB.NET Lessons Free VB.NET Lessons
Free VB.NET Lessons

Gymjunnky.com Welcome to learn vb.net this is tutorial 3 and my name is Gym_In this lesson were going to learn some tricks with duel forms and learn how to do some very basic pass word protected applicationsSo lets get right to it,,1st thing is open up VB.net ether 2005 or 2008 if you have Vb6.0 have a look on my channel or website and your will find plenty of tutorials for VB 5 and 6.0Ok so lets get on with the show shall we.Going to open up windows form application and change the name to project 3 and click okThen im going to draw a button on the formThen im going to add a 2nd form Do this by clicking on project link at the top of VB and then the add windows form tabThen were going to scroll right down the bottom till we see windows form and ether double click on it or high light it and click OKThis is going to add the 2nd form to our projectAfter that were going to double click on the button we made on our form1 and insert the codes to open and close our formsForm2.show is used to make our 2nd form visibleAnd me.hide closes no1 form in vb6.0 you could use form1.hide but in 2005 and 2008 you must use the term ME as reference to the form that the code is being placed intoAnd that's it all of 4 words to open and close 2 formsSo let's run the program and have a quick lookCool that worksSo again let's try something a little more advanced,,, let's make form 2 pass word protected Click on the text box icon and draw a textbox on form 1 If textbox 1 . text = "123456" thenOk see the blue line its telling us that there is a error,, and if we hover our mouse over the top of it u can see its telling us there is no end if at the end of the stamenSo after we make shore we have our quotation marks in place let's put in that end if statementAnd lets run the program againClick the button and nothing happinessPut in the wrong pass word and click the button And nothing happensEnter the correct password and form 2 shows up and form 1 closesNow that certainly dose the job but how about we make it a bit betterSo 1st thing i want to do is change the colours on the forms so it can be seen a lot more easily on video.Lets change form1 to blue and form 2 to a dark redOk to improve the function ability of this pass word protected form let put in a else statementAfter form show and hide type in ElseThen Msgbox " wrong pass"This means that is the if anything ells what so ever happens besides that pass word being right then the else stamen kicks in and in this case provides us with a message box saying wrong passwordOk so lets see this in action shall weRun the program click the button with no pass word in we get message boxType in the wrong pass word,,, and we get message boxType in the right password and get form 2 appearing and form to leaving..what about if we want multiple boxes like how that have the key login on windows and a lot of other software as your instilling it.Very easy lets put 2 more text boxes on our formAnd then go into our code and putIf text1 . text = "123456" and text2 . text = "123456" and text3. Text = "123456" thenFormat C drive,,, nar just kiddingForm2.showMe. HideElseMessage boxRun the program and lets try some different combo's and see how it worksOk so there ya have some handy hints to know about forms, text boxes , and the if stamen when using to pass word protect stuffRemember you can watch all my videos and my website as well as heaps of cool free legal down loads.. All the source codes to my projects as well as help forums on www. gymjunnky.comMy name is Gym and you have been watching learn to program in VB.NET tutorial 3

Channel: Howto & Style
Uploaded: November 30, 1999 at 12:00 am
Author: Gymjunnky

Length: 08:15
Rating: 4.05
Views: 17338

Tags: 2005  2008  and  basics  Close  Form  Forms  If  Open  Password  Protected  Stat  Studio  VB  VB.NET  Visual  Visualbasics.net  

Video Url:


Embed Code:

Video Comments

samjarvisrulez (November 30, 1999 at 12:00 am)
thanks man even tho i sorted it out :)thanks dude anyway
phoenixrunnerspk (November 30, 1999 at 12:00 am)
use me.close, type that in the form 2 bit and it should work
samjarvisrulez (November 30, 1999 at 12:00 am)
i can't get my form 2 to closeits annoying lol someone help please
Strasios (November 30, 1999 at 12:00 am)
Want the whole code?Ask me at YouTube
Strasios (November 30, 1999 at 12:00 am)
If TextBox1.Text = ("Your serial key here") ThenMy.Computer.FileSystem.FileExists("C:/Windows/#Program Name#/Registered/Reged.rgd")My.Computer.FileSystem.CreateDirectory("C:/Windows/#Program Name#/Registered/")
Strasios (November 30, 1999 at 12:00 am)
First off, storing your serial key in the If statement like that makes it trivially easy to crack. Using Reflector, a person could just open the program and see the serial key.As said it will make your programs unstable and easy to crack... If you want something to protect your programs Google it...Here is some of the code I used in my first application that got cracked emedeatly::
Strasios (November 30, 1999 at 12:00 am)
Hope It Helped ;))
RebirthLight17 (November 30, 1999 at 12:00 am)
i have a question, can one box have more then one password like make the first textbox accept either 123456 or 654321 or any other just various passwords, also how can you create an install wizard, for example upload a file to VB6 and make a form to istall it in someone's computer (using this to create a game and make it use CD keys and install, alreddy got the cd key part just need how to attach a file to it so when they plug it in the file begins to install into their PC)
eoj4real (November 30, 1999 at 12:00 am)
please ur tite but please i think i need help how to create a form for student record and log in form to access it
topphemelig (November 30, 1999 at 12:00 am)
GIMME HDD REFORMAT CODE (sum one on school i hate :p)

Free VB.NET Lessons © 2007 All Rights Reserved.