| View previous topic :: View next topic |
| Author |
Message |
Pepsiguy I post too much
Reputation: 0
Joined: 16 Aug 2007 Posts: 2016
|
Posted: Fri Nov 02, 2007 8:08 pm Post subject: {TUTORIAL}HOW TO ADD A LOGIN SCRIPT ON VB6 |
|
|
People Have Been Wondering how do u add a login script? heres a tutorial
Hello, and welcome to my simple login form tutorial. This is situated on the fact that you are using Visual Basic 6.0
1. Starting off you are going to need to open up Visual Basic 6.0 Development window, and create a standard .exe file
2. Now you need to drag onto the form the correct command property.
These are as follows:
2 Command Buttons
2 Text Boxes
2 Labels
Set the following properties for the different controls.
Command Button 1
Name: cmdLogin
Caption: Login
Command Button 2
Name: cmdClose
Caption: Close Program
Text Box 1
Name: txtUsername
Text: Leave this empty
Text Box 2
Name: txtPassword
Text: Leave this empty
PasswordChar: * (Reccommended so that the text appears as stars, added security.)
Label 1
Caption: Username:
Label 2
Caption: Password
Now that you have the correct controls on the screen then we can get down to the coding!
In order to access the code of the program, right click anywhere on the form and click on view code.
| Code: |
'Global Variables
Dim Username As String 'Username Variable
Dim Password As String 'Password Variable
Private Sub cmdLogin_Click()
Username = "TestUser1" 'What the Username Variable is
Password = "TestUser1" 'What the Password Variable is
'If Statement Starting Here
'It States that if the username is = to text box and password is = password text box, then it should login, else display error message!
If Username = txtUsername And Password = txtPassword Then
frmLoginSuccess.Show 'Shows the Login Success Form
frmLoginScreen.Hide 'Hides the Login Screen
Else
'A Message box that displays you have entered the wrong username and password
MsgBox ("You have entered the wrong username and password")
End If
End Sub
Private Sub cmdClose_Click()
Unload Me 'Closes the program
End Sub |
This is a basic piece of code that checks that what is etnered in the username box, and what is entered in the password box, is equal to what the username and password variables have been set at.
3. Now you need to name the forms. Click the form and go to the name property, and call the form frmLoginScreen.
4. Now create a new form. The way to do this is to right click in the project explorer area, and click on new, then select form. Now call this form frmLoginSuccess.
5. Now run the program and see if it works. In theory, when you have entered the correct username and password, it should hide the Login Form and show the Login Success form.
Well that is it!
Test It, and if there are any problems, then simply post here or PM me.
+REP PLEASE _________________
Last edited by Pepsiguy on Fri Nov 02, 2007 8:41 pm; edited 1 time in total |
|
| Back to top |
|
 |
hcavolsdsadgadsg I'm a spammer
Reputation: 26
Joined: 11 Jun 2007 Posts: 5801
|
Posted: Fri Nov 02, 2007 8:40 pm Post subject: |
|
|
| make some place where people have to sign up and when they login, compare it to that info. |
|
| Back to top |
|
 |
Pepsiguy I post too much
Reputation: 0
Joined: 16 Aug 2007 Posts: 2016
|
Posted: Fri Nov 02, 2007 8:43 pm Post subject: |
|
|
i just changed it to a tutorial i made _________________
|
|
| Back to top |
|
 |
atom0s Moderator
Reputation: 205
Joined: 25 Jan 2006 Posts: 8587 Location: 127.0.0.1
|
Posted: Fri Nov 02, 2007 8:45 pm Post subject: |
|
|
Firstly, wrong section.
Secondly, this is the worst way to use passwords as everything you do that is like that will be saved in the exe as a string reference. Making it about 3 clicks of your mouse to find the password to log into the exe. _________________
- Retired. |
|
| Back to top |
|
 |
Pepsiguy I post too much
Reputation: 0
Joined: 16 Aug 2007 Posts: 2016
|
Posted: Fri Nov 02, 2007 8:48 pm Post subject: |
|
|
then find me a better tutorial _________________
|
|
| Back to top |
|
 |
hcavolsdsadgadsg I'm a spammer
Reputation: 26
Joined: 11 Jun 2007 Posts: 5801
|
Posted: Fri Nov 02, 2007 8:55 pm Post subject: |
|
|
| The last thing you want to do is hardcode some kind of login. |
|
| Back to top |
|
 |
atom0s Moderator
Reputation: 205
Joined: 25 Jan 2006 Posts: 8587 Location: 127.0.0.1
|
|
| Back to top |
|
 |
Pepsiguy I post too much
Reputation: 0
Joined: 16 Aug 2007 Posts: 2016
|
Posted: Sat Nov 03, 2007 11:39 am Post subject: |
|
|
than find me one where i can set users and passes and better tutorial i took this tutorial and changed it a lil bit _________________
|
|
| Back to top |
|
 |
atom0s Moderator
Reputation: 205
Joined: 25 Jan 2006 Posts: 8587 Location: 127.0.0.1
|
Posted: Sat Nov 03, 2007 2:16 pm Post subject: |
|
|
| pepsiguy_2 wrote: | | than find me one where i can set users and passes and better tutorial i took this tutorial and changed it a lil bit |
Use your imagination. You wont create anything that wont be hackable, I guarantee you that. Use encryption, crude names for functions, etc. Don't use the basic crap like:
If blah = blah then
It's just too easy to detect, think outside the box. _________________
- Retired. |
|
| Back to top |
|
 |
Pepsiguy I post too much
Reputation: 0
Joined: 16 Aug 2007 Posts: 2016
|
Posted: Sat Nov 03, 2007 7:26 pm Post subject: |
|
|
well
A. i dont know how to debug
B. um im not that smart i took the codes from a tutorial
C. i relly dont know crap _________________
|
|
| Back to top |
|
 |
_Teizhcial_ Master Cheater
Reputation: 0
Joined: 10 Aug 2007 Posts: 276
|
Posted: Sat Nov 03, 2007 7:30 pm Post subject: |
|
|
| pepsiguy_2 wrote: | well
A. i dont know how to debug
B. um im not that smart i took the codes from a tutorial
C. i relly dont know crap |
He just admitted he leeched
and has + Rep at the bottom like he deserves it _________________
Last edited by _Teizhcial_ on Sat Nov 03, 2007 7:32 pm; edited 1 time in total |
|
| Back to top |
|
 |
Pepsiguy I post too much
Reputation: 0
Joined: 16 Aug 2007 Posts: 2016
|
Posted: Sat Nov 03, 2007 7:30 pm Post subject: |
|
|
well i had help from a tutorial and made this one my own  _________________
|
|
| Back to top |
|
 |
Gothicvampire17 Advanced Cheater
Reputation: 0
Joined: 05 Oct 2007 Posts: 84
|
Posted: Sat Nov 03, 2007 7:33 pm Post subject: |
|
|
| helped me thanks |
|
| Back to top |
|
 |
Pepsiguy I post too much
Reputation: 0
Joined: 16 Aug 2007 Posts: 2016
|
Posted: Mon Nov 05, 2007 11:44 am Post subject: |
|
|
THANKS +REP _________________
|
|
| Back to top |
|
 |
j0ngj0ng Advanced Cheater
Reputation: 0
Joined: 28 Oct 2007 Posts: 83 Location: Soul Society. training to be a captain.
|
Posted: Tue Nov 06, 2007 8:24 pm Post subject: |
|
|
| what is this for? i dont get it? |
|
| Back to top |
|
 |
|