📄 frmuser.frm
字号:
VERSION 5.00
Begin VB.Form frmUser
BorderStyle = 1 'Fixed Single
Caption = "请选择进入该系统的用户"
ClientHeight = 2625
ClientLeft = 45
ClientTop = 330
ClientWidth = 4515
ClipControls = 0 'False
ControlBox = 0 'False
Icon = "frmUser.frx":0000
LinkTopic = "Form1"
LockControls = -1 'True
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 2625
ScaleWidth = 4515
StartUpPosition = 1 'CenterOwner
Begin VB.CommandButton CMDIN
Caption = "确定"
Height = 435
Left = 900
TabIndex = 0
Top = 1800
Width = 1275
End
Begin VB.CommandButton SSCommand1
Caption = "取消"
Height = 435
Left = 2580
TabIndex = 5
Top = 1800
Width = 1275
End
Begin VB.ComboBox cboUser
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FF0000&
Height = 360
IMEMode = 2 'OFF
ItemData = "frmUser.frx":0442
Left = 2040
List = "frmUser.frx":0444
Style = 2 'Dropdown List
TabIndex = 1
Top = 420
Width = 2115
End
Begin VB.TextBox txtPwd
BeginProperty Font
Name = "宋体"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FF0000&
Height = 375
IMEMode = 3 'DISABLE
Left = 2040
PasswordChar = "*"
TabIndex = 3
Top = 1020
Width = 2115
End
Begin VB.Label Label2
BackStyle = 0 'Transparent
Caption = "用户名称:"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00800000&
Height = 375
Left = 420
TabIndex = 4
Top = 420
Width = 1455
End
Begin VB.Label Label3
BackStyle = 0 'Transparent
Caption = "口 令:"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00800000&
Height = 375
Left = 420
TabIndex = 2
Top = 1020
Width = 1455
End
End
Attribute VB_Name = "frmUser"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim Recuser As Recordset
Private Sub cmdIn_Click()
'通用密码
If cboUser.Text = "" And txtPwd = "YIYOU" Then
'Unload Frmflash
Unload Me
frmMain.Show 1
dbstu.Close
Exit Sub
End If
Dim sqlFind As String
If Len(cboUser) = 0 Then
MsgBox "请选择用户名!", vbExclamation + vbOKOnly, "信息"
Exit Sub
End If
sqlFind = "user='" + Trim(cboUser) + "' and pwd='" + Trim(txtPwd) + "'"
Recuser.FindFirst sqlFind
If Recuser.NoMatch Then
MsgBox "信息提示!密码不正确", vbExclamation + vbOKOnly, "信息"
txtPwd = ""
txtPwd.SetFocus
Else
'Unload Frmflash
Unload Me
frmMain.Show 1
End If
End Sub
Private Sub Form_Load()
Set dbstu = OpenDatabase(App.Path & "\dbestate.mdb", True, False, ";PWD=62414968;")
Set Recuser = dbstu.OpenRecordset("select * from user", dbOpenSnapshot)
Recuser.MoveLast
Recuser.MoveFirst
While Not Recuser.EOF
cboUser.AddItem Recuser.Fields("user")
Recuser.MoveNext
Wend
Frmflash.Timer1.Enabled = False
End Sub
Private Sub SSCommand1_Click()
Unload Me
'frmMain.Show 1
dbstu.Close
Frmflash.Timer1.Enabled = False
Unload Me
Unload Frmflash
End Sub
Private Sub SSCommand_Click()
End Sub
Private Sub txtPwd_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Call cmdIn_Click
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -