📄 frmlogin.frm
字号:
VERSION 5.00
Begin VB.Form frmLogin
BorderStyle = 1 'Fixed Single
Caption = "登录窗口"
ClientHeight = 3510
ClientLeft = 45
ClientTop = 330
ClientWidth = 5550
ControlBox = 0 'False
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 3510
ScaleWidth = 5550
StartUpPosition = 3 'Windows Default
Begin VB.CommandButton confirm
Caption = "确认[&T)"
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 4215
TabIndex = 17
Top = 450
Width = 975
End
Begin VB.CommandButton CaclCmd
Caption = "放弃[&C]"
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 4215
TabIndex = 16
Top = 1170
Width = 975
End
Begin VB.Frame Frame1
Height = 1575
Left = 135
TabIndex = 7
Top = 90
Width = 3615
Begin VB.CommandButton cmdDate
Appearance = 0 'Flat
Height = 330
Left = 3015
Picture = "frmLogin.frx":0000
Style = 1 'Graphical
TabIndex = 12
Top = 225
Width = 315
End
Begin VB.CommandButton cmdChange
Height = 315
Left = 3015
Picture = "frmLogin.frx":018A
Style = 1 'Graphical
TabIndex = 11
Top = 1170
Width = 330
End
Begin VB.TextBox txtPass
BackColor = &H00FFFFFF&
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 270
IMEMode = 3 'DISABLE
Left = 1080
MaxLength = 8
PasswordChar = "*"
TabIndex = 10
Top = 1200
Width = 1935
End
Begin VB.ComboBox Combo1
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 300
Left = 1080
Style = 2 'Dropdown List
TabIndex = 9
Top = 700
Width = 2295
End
Begin VB.TextBox txtDate
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 270
Left = 1080
Locked = -1 'True
TabIndex = 8
Top = 240
Width = 1935
End
Begin VB.Label Label3
Caption = "口 令:"
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Index = 0
Left = 120
TabIndex = 15
Top = 1200
Width = 1095
End
Begin VB.Label Label2
Caption = "操 作 员:"
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 120
TabIndex = 14
Top = 720
Width = 975
End
Begin VB.Label Label1
Caption = "业务日期:"
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 120
TabIndex = 13
Top = 240
Width = 1095
End
End
Begin VB.Frame Frame2
Height = 1575
Left = 135
TabIndex = 0
Top = 1770
Width = 3615
Begin VB.TextBox txtCpass
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 270
IMEMode = 3 'DISABLE
Left = 1080
MaxLength = 8
PasswordChar = "*"
TabIndex = 3
Top = 1200
Width = 1935
End
Begin VB.TextBox txtNpass
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 270
IMEMode = 3 'DISABLE
Left = 1080
MaxLength = 8
PasswordChar = "*"
TabIndex = 2
Top = 720
Width = 1935
End
Begin VB.TextBox txtOpass
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 270
IMEMode = 3 'DISABLE
Left = 1080
MaxLength = 8
PasswordChar = "*"
TabIndex = 1
Top = 240
Width = 1935
End
Begin VB.Label Label6
Caption = "确认口令:"
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 120
TabIndex = 6
Top = 1200
Width = 975
End
Begin VB.Label Label5
Caption = "新 口 令:"
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 120
TabIndex = 5
Top = 720
Width = 975
End
Begin VB.Label Label4
Caption = "旧 口 令:"
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 240
Left = 120
TabIndex = 4
Top = 240
Width = 975
End
End
End
Attribute VB_Name = "frmLogin"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim Rs As Recordset
Dim AddName As String
Dim AddCode As String
Dim IfChgPass As Boolean
Dim I As Integer
Private Sub CaclCmd_Click()
Unload Me
Unload frmMain
End Sub
Private Sub cmdChange_Click()
Me.Height = 3915
IfChgPass = True
txtPass.Text = ""
txtOpass.SetFocus
txtPass.BackColor = &HC0C0C0
txtPass.Enabled = False
End Sub
Function FindFlag(FindField As Field, FindStr As String) As Boolean
FindFlag = False
With Rs
.MoveFirst
Do While Not (.EOF)
If FindField = FindStr Then
FindFlag = True
Exit Function
End If
.MoveNext
Loop
End With
End Function
Private Sub cmdDate_Click()
frmcalendar.Show 1
txtDate.Text = Format(Getdate, "long date")
End Sub
Private Sub confirm_Click()
UserCode = Left(Combo1.Text, 3)
Myname = Mid(Combo1.Text, 5)
CurrUser = UserCode
Dim mycode As String
With Rs
.MoveFirst
If FindFlag(!UserCode, Left(Combo1.Text, 3)) Then
End If
If IfChgPass = False Then
If LTrim("" & !userpass) = Trim(txtPass.Text) Then
Else
I = I + 1
If I = 4 Then
End
End If
If I = 3 Then
MsgBox ("口令错误,你还有一次机会!")
txtPass.SetFocus '获得焦点
SendKeys "{Home}+{End}"
Exit Sub
End If
MsgBox ("口令错误,请从新输入!")
txtPass.SetFocus '获得焦点
SendKeys "{Home}+{End}"
Exit Sub
End If
End If
If IfChgPass = True Then
If LTrim("" & !userpass) = Trim(txtOpass.Text) Then
If txtNpass.Text = txtCpass.Text Then
.Edit
!userpass = txtNpass.Text
.Update
MsgBox ("成功改变口令!")
txtPass.BackColor = &H80000005
txtPass.Enabled = True
txtPass.Text = txtNpass.Text
Me.Height = 2235
IfChgPass = False
Else
MsgBox ("新口令与确认口令不一致,请重新输入!")
txtNpass.SetFocus
SendKeys "{Home}+{End}"
End If
Else
MsgBox ("原口令错误,请重新输入!")
txtOpass.SetFocus
SendKeys "{Home}+{End}"
End If
End If
End With
IntUser = Rs!UserName
Intodate = Format(txtDate.Text, "long date")
Unload Me
frmMain.Show
End Sub
Private Sub Form_Activate()
Combo1.SetFocus
End Sub
Private Sub Form_Load()
I = 1
IfChgPass = False
Move (Screen.Width - Width) \ 2, (Screen.Height - Height) \ 2
Me.Height = 2235
Set Dbs = OpenDatabase(App.Path & "\daily.mdb")
Set Rs = Dbs.OpenRecordset("rights")
txtDate.Text = Format(Date, "long date")
With Rs
.MoveFirst
Do While Not (.EOF)
AddName = !UserName
AddCode = !UserCode
Combo1.AddItem (AddCode & " " & AddName)
.MoveNext
Loop
.MoveFirst
Combo1.Text = !UserCode & " " & !UserName
End With
End Sub
Private Sub Form_Unload(Cancel As Integer)
Rs.Close
End Sub
Private Sub txtNpass_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txtCpass.SetFocus
End If
End Sub
Private Sub txtOpass_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txtNpass.SetFocus
End If
End Sub
Private Sub txtPass_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
confirm.SetFocus
Call confirm_Click
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -