Archive
Categories
- Antivirus (4)
- Applications (5)
- Books and Articles (24)
- Computer Tutorials (10)
- Flash (3)
- Game (4)
- Graphic Design Tutorials (13)
- Internet Software (5)
- Internet Tutorials (12)
- Movie (8)
- Music (4)
- Novel Collections (5)
- Photoshop (10)
- Programming Tutorials (12)
- Template (3)
Tutorial : Source code Login in Visual Basic
12:18 AM |
Diposkan oleh
Fiola |
Edit Post
This time I will try to provide a simple source code to Log In. Why do I say simple, because it is permanent Log In for username and password, that user name and password I put directly on the source code. So when running a program, we must know the user name and password that you input in the source code. This program is equipped with a progressbar to add variety.
Create a form that consists of 2 labels for users and passwords, 2 textbox also for users and passwords, 2 combobox to the Log In and Out, 1 Timmer, and a progressbar. Then create another 1 form that we use to form the main menu. The following source code :
Private Sub Cmd_log_Click()
If Text_user = “” And Text_pass = “” Then
MsgBox (“Isi dulu User dan Passwordnya…!!!”), vbInformation, “Sory…..”
Text_user.Text = “”
Text_pass.Text = “”
Text_user.SetFocus
ElseIf Text_user = “” Then
MsgBox (“Isi dulu Usernya…!!!”), vbInformation, “Sory…..”
Text_user.Text = “”
Text_user.SetFocus
ElseIf Text_pass = “” Then
MsgBox (“Isi dulu Passwordnya…!!!”), vbInformation, “Sory…..”
Text_pass.Text = “”
Text_pass.SetFocus
ElseIf Text_user = “ADMIN” And Text_pass = “1234″ Then
MsgBox (“Selemat Datang…”), vbOKOnly, “Welcome”
Timer1.Enabled = True
ElseIf Text_user <> “ADMIN” Then
MsgBox (“User salah..!!!!”), vbInformation, “Ooops…”
Text_user.Text = “”
Text_user.SetFocus
ElseIf Text_pass <> “1234″ Then
MsgBox (“Password salah..!!!!”), vbInformation, “Ooops…”
Text_pass.Text = “”
Text_pass.SetFocus
Else
MsgBox (“User dan password salah…”), vbInformation, “Ooops…”
Text_user.Text = “”
Text_pass.Text = “”
Text_user.SetFocus
End If
End Sub
Private Sub Form_Activate()
Text_user.SetFocus
End Sub
Private Sub Form_Load()
Text_user = “”
Text_pass = “”
Text_pass.PasswordChar = “*”
ProgressBar1.Min = 0
ProgressBar1.max = 1000
Timer1.Enabled = False
End Sub
Private Sub Text_pass_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then Cmd_log.SetFocus
End Sub
Private Sub Text_user_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then Text_pass.SetFocus
End Sub
Private Sub Timer1_Timer()
Dim i As Integer
For i = ProgressBar1.Min To ProgressBar1.max
ProgressBar1.Value = i
If ProgressBar1.Value = 1000 Then
Unload Me
menu.Show
End If
Next
End Sub
Label:
Programming Tutorials,
Tutorial
Subscribe to:
Post Comments (Atom)
0 komentar:
Post a Comment