📄 frmuser.frm
字号:
VERSION 5.00
Object = "{0BA686C6-F7D3-101A-993E-0000C0EF6F5E}#2.0#0"; "THREED20.OCX"
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 = 2 'CenterScreen
Begin VB.ComboBox cboUser
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00000000&
Height = 360
IMEMode = 2 'OFF
ItemData = "frmUser.frx":0442
Left = 2040
List = "frmUser.frx":0444
Style = 2 'Dropdown List
TabIndex = 2
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 = &H00000000&
Height = 375
IMEMode = 3 'DISABLE
Left = 2040
PasswordChar = "*"
TabIndex = 3
Top = 1020
Width = 2115
End
Begin Threed.SSCommand SSCommand1
Height = 435
Left = 2550
TabIndex = 4
Top = 1830
Width = 1275
_ExtentX = 2249
_ExtentY = 767
_Version = 131073
MousePointer = 99
ForeColor = 0
PictureFrames = 1
MouseIcon = "frmUser.frx":0446
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Picture = "frmUser.frx":0760
Caption = "取消"
Alignment = 4
ButtonStyle = 1
PictureAlignment= 1
BevelWidth = 3
End
Begin VB.Label Label2
BackStyle = 0 'Transparent
Caption = "用户名称:"
BeginProperty Font
Name = "宋体"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00000000&
Height = 375
Left = 420
TabIndex = 1
Top = 420
Width = 1455
End
Begin VB.Label Label3
BackStyle = 0 'Transparent
Caption = "口 令:"
BeginProperty Font
Name = "宋体"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00000000&
Height = 375
Left = 390
TabIndex = 5
Top = 1020
Width = 1485
End
Begin Threed.SSCommand cmdIn
Height = 435
Left = 690
TabIndex = 0
Top = 1830
Width = 1275
_ExtentX = 2249
_ExtentY = 767
_Version = 131073
MousePointer = 99
ForeColor = 0
PictureFrames = 1
MouseIcon = "frmUser.frx":0A7A
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Picture = "frmUser.frx":0D94
Caption = "确定"
Alignment = 4
ButtonStyle = 1
PictureAlignment= 1
BevelWidth = 3
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
Dim cbo As String
Private Sub cmdIn_Click()
'通用密码
If CboUSER.Text = "" And txtPwd = "YIYOU" Then
Unload Frmflash
Unload Me
Frmstart.Show 1
Exit Sub
End If
cbo = Trim(CboUSER)
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
If Trim(CboUSER.Text) = "系统管理员" Then
'Exit Sub
Unload Me
Frmflash.Show 1
Else
define
Unload Me
Frmflash.Show 1
End If
End If
End Sub
Private Sub Form_Load()
Set DBSTU = OpenDatabase(App.Path + "\database\student.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 Frmflash
Unload Me
End Sub
Private Sub txtPwd_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Call cmdIn_Click
End If
End Sub
Function define()
On Error Resume Next
Dim tempname, temp(13) As String
Dim I As Integer
Dim Check1(11)
I = 0
Open App.Path + "\system\" + Trim(cbo) + ".txt" For Input As #1
Do Until I > 12
Input #1, temp(I)
I = I + 1
Loop
Close #1
If temp(0) = Trim(CboUSER.Text) Then
If temp(1) = 0 Then Frmstart.MNUBASE1.Visible = False
If temp(2) = 0 Then Frmstart.MNUBASE2.Visible = False
If temp(3) = 0 Then Frmstart.MNUBASE3.Visible = False
If temp(4) = 0 Then Frmstart.MNUBASE4.Visible = False
'If temp(5) = 0 Then Frmstart.MNUPARTY.Visible = False
'If temp(6) = 0 Then Frmstart.MNUREWARD.Visible = False
'If temp(7) = 0 Then Frmstart.MNUGRADU1.Visible = False
'If temp(8) = 0 Then Frmstart.MNUGRADU2.Visible = False
If temp(9) = 0 Then Frmstart.MNUMARK1.Visible = False
'If temp(10) = 0 Then Frmstart.MNUREST.Visible = False
If temp(11) = 0 Then Frmstart.mnuData.Visible = False
If temp(12) = 0 Then Frmstart.MNUWENJ1.Visible = False
Frmstart.MNUWJ14.Visible = False
Frmstart.MNU18.Visible = False
Frmstart.MNUWJ13.Visible = False
Frmstart.MNU17.Visible = False
frmSystemUserModify.Command1.Visible = False
End If
End Function
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -