📄 frmzx.frm
字号:
VERSION 5.00
Begin VB.Form frmzx
BorderStyle = 3 'Fixed Dialog
Caption = "注销用户"
ClientHeight = 2745
ClientLeft = 45
ClientTop = 435
ClientWidth = 4680
ControlBox = 0 'False
Icon = "frmzx.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 2745
ScaleWidth = 4680
ShowInTaskbar = 0 'False
StartUpPosition = 2 '屏幕中心
Begin VB.Frame Frame1
Caption = "具体信息"
Height = 2295
Left = 120
TabIndex = 5
Top = 360
Width = 4455
Begin VB.CommandButton cmdcancel
Caption = "取消(&C)"
Height = 375
Left = 2520
TabIndex = 4
Top = 1680
Width = 1695
End
Begin VB.CommandButton cmdok
Caption = "确定(&Q)"
Height = 375
Left = 2520
TabIndex = 3
Top = 1200
Width = 1695
End
Begin VB.TextBox txtmima
Height = 375
IMEMode = 3 'DISABLE
Left = 2520
PasswordChar = "*"
TabIndex = 2
Top = 720
Width = 1695
End
Begin VB.ListBox listyonghu
Height = 1680
ItemData = "frmzx.frx":08CA
Left = 120
List = "frmzx.frx":08CC
TabIndex = 1
Top = 480
Width = 1815
End
Begin VB.Label Label3
AutoSize = -1 'True
Caption = "请输入密码:"
Height = 180
Left = 2160
TabIndex = 7
Top = 480
Width = 990
End
Begin VB.Label Label2
AutoSize = -1 'True
Caption = "用户:"
Height = 180
Left = 120
TabIndex = 6
Top = 240
Width = 450
End
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "请选择用户名并输入密码:"
Height = 180
Left = 240
TabIndex = 0
Top = 120
Width = 2070
End
End
Attribute VB_Name = "frmzx"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub cmdcancel_Click()
If MsgBox("取消注销将退出系统,您确定要取消注销吗?", 36, "信息提示") = vbYes Then
Unload Me
End
End If
End Sub
Private Sub cmdok_Click()
Dim username As String
Dim userpass As String
Dim username1 As String
Dim userpass1 As String
Dim sql1 As String
If txtmima.Text = "" Then
MsgBox "请选择用户!", 48, "信息提示"
Exit Sub
End If
Dim rs As New ADODB.Recordset
username = listyonghu.List(listyonghu.ListIndex)
userpass = MD5(Trim(txtmima.Text))
sql = "select * from admin where caozuoyuan='" & username & "'"
sql1 = "select * from admin where mima='" & userpass & "'"
rs.open sql, cn
ifmana = rs!isguanli
mingzi = rs!caozuoyuan
username1 = rs!caozuoyuan
userpass1 = rs!mima
rs.Close
'确认操作员和密码
If username = username1 And userpass = userpass1 Then
MsgBox "系统登陆成功!", 48, "信息提示" '系统登录成功
Unload Me
If ifmana = False Then '以此判断进入的用户的操作权限
frmmain.Show
frmmain.lblxianshi.Caption = mingzi
frmmain.glyh.Enabled = False
frmmain.hpcs.Enabled = False
frmmain.xgzl.Enabled = False
frmmain.xgmm.Enabled = False
frmmain.tjzl.Enabled = False
frmmain.sjbf.Enabled = False
frmmain.lblquanxian.Caption = "操作员"
Else
frmmain.Show
frmmain.lblxianshi.Caption = mingzi
frmmain.glyh.Enabled = True
frmmain.hpcs.Enabled = True
frmmain.xgzl.Enabled = True
frmmain.xgmm.Enabled = True
frmmain.tjzl.Enabled = True
frmmain.sjbf.Enabled = True
frmmain.lblquanxian.Caption = "管理员"
End If
Else
MsgBox "密码或管理权限有错误,请重新输入!", 48, "信息提示"
txtmima.SetFocus
txtmima.Text = ""
End If
End Sub
Private Sub Form_Load()
Dim rs As New ADODB.Recordset
Dim sql As String
sql = "select caozuoyuan from admin"
rs.open sql, cn
listyonghu.Clear
Do While Not rs.EOF
listyonghu.AddItem rs!caozuoyuan
rs.MoveNext
Loop
End Sub
Private Sub listyonghu_Click()
txtmima.SetFocus
End Sub
Private Sub txtmima_KeyPress(KeyAscii As Integer)
If Trim(txtmima.Text) <> "" And KeyAscii = 13 Then
cmdok_Click
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -