Archive

Headline

Sharing Information

Visitor

free counters

Trafict & Ranking

SEO Stats powered by MyPagerank.Net
Powered by  MyPagerank.Net Yahoo bot last visit powered by MyPagerank.Net Msn bot last visit powered by MyPagerank.Net

Tutorial : Source code Login in Visual Basic

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

0 komentar:

Post a Comment

Related Posts Plugin for WordPress, Blogger...

Translate

Subscribe Here

Enter your email address:

Like Facebook

Online Chat Comment

Reference

Stats and info

Top Referrer