- Joined
- Apr 23, 2011
- Posts
- 3,200
- Reaction score
- 793
- Points
- 113
- Age
- 53
****** MOD NOTICE: I cannot access the bot resources forum. Therefore i post here. If a mod could move it or give me access (Preferred) the please do so******
SIMPLE PASS
A TuT by desttroy
This is a simple piece of code to protect your programs
The code is very simple.
It uses Conditional Operators (If and else) to detect if the correct password is entered.
So IF you enter "pass" into textbox1 the program will display form 2
if you enter anything ELSE then it will show an error.
Advanced Code:
This has a Username and a Password Field. It also has 2 users instead of one
SIMPLE PASS
A TuT by desttroy



This is a simple piece of code to protect your programs
Code:
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If TextBox1.Text = "pass" Then
Form2.Show()
ElseIf TextBox1.Text <> "pass" Then
MessageBox.Show("You FAIL K :P !")
End If
End Sub
End Class
It uses Conditional Operators (If and else) to detect if the correct password is entered.
So IF you enter "pass" into textbox1 the program will display form 2
if you enter anything ELSE then it will show an error.
Advanced Code:
Code:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If TextBox1.Text = "" Or TextBox2.Text = "" Then
MessageBox.Show("You didn't fill in the fields!")
End If
If TextBox1.Text = "admin" Or TextBox1.Text = "me" And TextBox2.Text = "pass" Or TextBox2.Text = "u" Then
Me.Hide()
ElseIf MessageBox.Show("You entered the wrong username or password !") Then
End If
End Sub