update,
This commit is contained in:
64
jimmycheung93/task4/1/frmLogin.frm
Normal file
64
jimmycheung93/task4/1/frmLogin.frm
Normal file
@@ -0,0 +1,64 @@
|
||||
VERSION 5.00
|
||||
Begin {C62A69F0-16DC-11CE-9E98-00AA00574A4F} frmLogin
|
||||
Caption = "Login"
|
||||
ClientHeight = 7200
|
||||
ClientLeft = 120
|
||||
ClientTop = 465
|
||||
ClientWidth = 5700
|
||||
OleObjectBlob = "frmLogin.frx":0000
|
||||
StartUpPosition = 1 'CenterOwner
|
||||
End
|
||||
Attribute VB_Name = "frmLogin"
|
||||
Attribute VB_GlobalNameSpace = False
|
||||
Attribute VB_Creatable = False
|
||||
Attribute VB_PredeclaredId = True
|
||||
Attribute VB_Exposed = False
|
||||
Option Explicit
|
||||
|
||||
Dim i As Integer
|
||||
Dim j As Integer
|
||||
Dim k As Integer
|
||||
|
||||
Private Sub cmdExitLogin_Click()
|
||||
End
|
||||
End Sub
|
||||
|
||||
Private Sub cmdLogin_Click()
|
||||
Dim username_found As Boolean
|
||||
|
||||
username_found = False
|
||||
|
||||
' currently 100 users is good enough
|
||||
For i = 1 To 100
|
||||
If (txtUsername.Text = usernames(i)) Then
|
||||
If (txtPassword.Text = passwords(i)) Then
|
||||
|
||||
' login success, show main form
|
||||
frmLogin.Hide
|
||||
frmMain.Show
|
||||
username_found = True
|
||||
End If
|
||||
End If
|
||||
Next i
|
||||
|
||||
If (username_found = False) Then
|
||||
' login fail, show error message
|
||||
MsgBox "sorry but username and password wrong"
|
||||
End If
|
||||
End Sub
|
||||
|
||||
|
||||
Private Sub UserForm_Initialize()
|
||||
Debug.Print "start"
|
||||
|
||||
Common.initAccountFromAccountSheet
|
||||
Debug.Print "init account list done"
|
||||
|
||||
Config.init
|
||||
Debug.Print "config init done"
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user