📄 frmlogin.frm
字号:
VERSION 5.00
Begin VB.Form frmLogin
BorderStyle = 1 'Fixed Single
Caption = "登陆"
ClientHeight = 2010
ClientLeft = 45
ClientTop = 390
ClientWidth = 3855
Icon = "frmLogin.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
ScaleHeight = 2010
ScaleWidth = 3855
StartUpPosition = 2 '屏幕中心
Tag = "Login"
Begin VB.Frame Frame2
Height = 1935
Left = 0
TabIndex = 9
Top = 0
Visible = 0 'False
Width = 3855
Begin VB.CommandButton Button3
Caption = "取消"
Height = 255
Left = 2640
TabIndex = 15
Top = 1440
Width = 735
End
Begin VB.CommandButton cmdCPOK
Caption = "确定"
Height = 255
Left = 1800
TabIndex = 14
Top = 1440
Width = 735
End
Begin VB.TextBox txtOldPWD
Height = 285
IMEMode = 3 'DISABLE
Left = 1680
PasswordChar = "*"
TabIndex = 6
Top = 240
Width = 1845
End
Begin VB.TextBox txtNewPWD
Height = 285
IMEMode = 3 'DISABLE
Left = 1680
PasswordChar = "*"
TabIndex = 8
Top = 600
Width = 1845
End
Begin VB.TextBox txtConfirmNewPWD
Height = 285
IMEMode = 3 'DISABLE
Left = 1680
PasswordChar = "*"
TabIndex = 10
Top = 960
Width = 1845
End
Begin VB.Label lblLabels
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "旧密码:"
BeginProperty Font
Name = "宋体"
Size = 11.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00000000&
Height = 225
Index = 2
Left = 480
TabIndex = 13
Tag = "&Password:"
Top = 240
Width = 780
End
Begin VB.Label lblLabels
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "新密码:"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00000000&
Height = 210
Index = 3
Left = 480
TabIndex = 12
Tag = "&Password:"
Top = 600
Width = 720
End
Begin VB.Label lblLabels
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "新密码确认:"
BeginProperty Font
Name = "宋体"
Size = 11.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00000000&
Height = 225
Index = 4
Left = 120
TabIndex = 11
Tag = "&Password:"
Top = 960
Width = 1350
End
End
Begin VB.Frame Frame1
Height = 1935
Left = 0
TabIndex = 0
Top = 0
Width = 3855
Begin VB.CommandButton Button2
Caption = "取消"
Height = 255
Left = 2040
TabIndex = 17
Top = 1080
Width = 855
End
Begin VB.CommandButton cmdLogin
Caption = "确定"
Height = 255
Left = 1080
TabIndex = 16
Top = 1080
Width = 855
End
Begin VB.PictureBox Picture1
Appearance = 0 'Flat
AutoRedraw = -1 'True
AutoSize = -1 'True
BorderStyle = 0 'None
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H80000008&
Height = 720
Left = 3000
Picture = "frmLogin.frx":1272
ScaleHeight = 720
ScaleWidth = 720
TabIndex = 5
ToolTipText = "欢迎进入中小型图书管理系统"
Top = 1080
Width = 720
End
Begin VB.TextBox txtUserName
Appearance = 0 'Flat
BackColor = &H00FFFFFF&
BeginProperty Font
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FF0000&
Height = 285
Left = 1080
MousePointer = 1 'Arrow
TabIndex = 1
Top = 240
Width = 1845
End
Begin VB.TextBox txtPassword
Appearance = 0 'Flat
Height = 285
IMEMode = 3 'DISABLE
Left = 1080
PasswordChar = "*"
TabIndex = 2
Top = 600
Width = 1845
End
Begin VB.Label Label1
Alignment = 2 'Center
Appearance = 0 'Flat
BackColor = &H80000005&
BackStyle = 0 'Transparent
Caption = "更改密码"
BeginProperty Font
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00C00000&
Height = 255
Left = 1080
MouseIcon = "frmLogin.frx":2DB4
MousePointer = 99 'Custom
TabIndex = 7
Top = 1440
Width = 1815
End
Begin VB.Label lblLabels
BackStyle = 0 'Transparent
Caption = "用户名:"
BeginProperty Font
Name = "宋体"
Size = 11.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00000000&
Height = 255
Index = 0
Left = 120
TabIndex = 4
Tag = "&User Name:"
Top = 240
Width = 1080
End
Begin VB.Label lblLabels
BackStyle = 0 'Transparent
Caption = "密码:"
BeginProperty Font
Name = "宋体"
Size = 11.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00000000&
Height = 255
Index = 1
Left = 360
TabIndex = 3
Tag = "&Password:"
Top = 600
Width = 1080
End
End
End
Attribute VB_Name = "frmLogin"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Option Base 1
Private Sub Button2_Click()
End
End Sub
Private Sub Button3_Click()
frmLogin.Caption = "Login"
Frame1.Visible = -1
Frame2.Visible = 0#
txtUserName.Text = ""
txtPassword.Text = ""
txtUserName.SetFocus
End Sub
Private Sub cmdCPOK_Click()
Dim vr_engine As VRENTAL_ENGINE
Set vr_engine = New VRENTAL_ENGINE
If txtOldPWD.Text = txtPassword.Text And txtNewPWD.Text = txtConfirmNewPWD.Text Then
'' ----- Start Update User 密码 Here
Call vr_engine.ChangePassword(txtNewPWD.Text, txtUserName.Text)
'' ----- End Update User 密码 Here
MsgBox "密码已经更改!", vbOKOnly, "成功更新"
Button3_Click
Else
MsgBox "Letters in passwords must be typed in correct case. ", vbCritical, "更改密码发生错误"
txtNewPWD.Text = ""
txtConfirmNewPWD.Text = ""
txtOldPWD.Text = ""
txtOldPWD.SetFocus
End If
End Sub
Private Sub cmdLogin_Click()
'Dim LogOnResult As String
Dim vr_engine As VRENTAL_ENGINE
Set vr_engine = New VRENTAL_ENGINE
LogOnResult = vr_engine.LogOnValidate(Trim(txtUserName.Text), Trim(txtPassword.Text))
If Trim(LogOnResult) <> "" Then
LogOnResult = LogOnResult & "LogInDateDate : " & Format(Now, "dddd, mmm d yyyy") & vbCrLf & "LogInTime : " & Format(Now, "hh:mm:ss AMPM") & vbCrLf
AssignUserInfoToGlobalVar (LogOnResult)
'' Append user to logfile
If vr_engine.ReportFileStatus(App.Path & "\UserLog.txt") = -1 Then
Open App.Path & "\UserLog.txt" For Append As #1
Print #1, gVarFirstName & " " & Left(gVarMiddleName, 1) & ". " & gVarFamilyName & " : " & Format(Now, "dddd, mmm d yyyy") & " : " & Format(Now, "hh:mm:ss AMPM") & vbCrLf '' Append to logfile
Close #1
Else
Open App.Path & "\UserLog.txt" For Output As #1
Print #1, txtUserName.Text & " : " & Format(Now, "dddd, mmm d yyyy") & " : " & Format(Now, "hh:mm:ss AMPM") & vbCrLf '' Append to logfile
Close #1
End If
'' End Appen to logfile format$
MDIForm1.Show
'Call Main
Unload Me
Else
MsgBox "非法用户名或密码!", vbInformation, "权限拒绝!"
txtUserName.Text = ""
txtPassword.Text = ""
txtUserName.SetFocus
End If
End Sub
Private Sub Label1_Click()
Dim LogOnResult As String
Dim vr_engine As VRENTAL_ENGINE
Set vr_engine = New VRENTAL_ENGINE
LogOnResult = vr_engine.LogOnValidate(Trim(txtUserName.Text), Trim(txtPassword.Text))
If Trim(LogOnResult) <> "" Then
'''4Erase MsgBox LogOnResult, vbOKOnly, "test"
Else
MsgBox "非法用户名或密码!", vbInformation, "权限拒绝!"
txtUserName.Text = ""
txtPassword.Text = ""
txtUserName.SetFocus
Exit Sub
End If
Frame2.Visible = -1
Frame1.Visible = 0
frmLogin.Caption = "Change 密码"
txtOldPWD.Text = ""
txtNewPWD.Text = ""
txtConfirmNewPWD.Text = ""
End Sub
Private Sub txtConfirmNewPWD_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then cmdCPOK_Click
End Sub
Private Sub txtNewPWD_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then cmdCPOK_Click
End Sub
Private Sub txtOldPWD_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then cmdCPOK_Click
End Sub
Private Sub txtPassword_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then cmdLogin_Click
End Sub
Private Sub txtUserName_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then cmdLogin_Click
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -