📄 form3.frm
字号:
VERSION 5.00
Begin VB.Form Form3
Caption = "系统管理---高校科研管理系统"
ClientHeight = 4305
ClientLeft = 60
ClientTop = 345
ClientWidth = 8325
Icon = "Form3.frx":0000
LinkTopic = "Form3"
ScaleHeight = 4305
ScaleWidth = 8325
StartUpPosition = 1 '所有者中心
Begin VB.CommandButton cmdExit
Caption = "退出"
Height = 375
Left = 6720
TabIndex = 18
Top = 3840
Width = 1335
End
Begin VB.Frame Frame6
BackColor = &H80000000&
Caption = "管理员密码修改"
Height = 3735
Left = 4080
TabIndex = 10
Top = 0
Width = 4215
Begin VB.CommandButton Command5
Caption = "修改"
Height = 375
Left = 2760
TabIndex = 14
Top = 3000
Width = 855
End
Begin VB.TextBox Text12
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
IMEMode = 3 'DISABLE
Left = 1920
PasswordChar = "*"
TabIndex = 13
Top = 1920
Width = 2175
End
Begin VB.TextBox Text11
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
IMEMode = 3 'DISABLE
Left = 1920
PasswordChar = "*"
TabIndex = 12
Top = 1200
Width = 2175
End
Begin VB.TextBox Text10
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
IMEMode = 3 'DISABLE
Left = 1920
PasswordChar = "*"
TabIndex = 11
Top = 480
Width = 2175
End
Begin VB.Label Label24
AutoSize = -1 'True
BackColor = &H80000000&
Caption = "管理员新密码核实:"
Height = 180
Left = 240
TabIndex = 17
Top = 2040
Width = 1530
End
Begin VB.Label Label23
AutoSize = -1 'True
BackColor = &H80000000&
Caption = "管理员新密码:"
Height = 180
Left = 600
TabIndex = 16
Top = 1440
Width = 1170
End
Begin VB.Label Label22
AutoSize = -1 'True
BackColor = &H80000000&
Caption = "管理员旧密码:"
Height = 180
Left = 600
TabIndex = 15
Top = 720
Width = 1170
End
End
Begin VB.Frame Frame5
BackColor = &H80000000&
Caption = "删除用户"
Height = 1455
Left = 0
TabIndex = 6
Top = 2280
Width = 3975
Begin VB.CommandButton Command3
Caption = "删除"
Height = 375
Left = 2760
TabIndex = 8
Top = 840
Width = 855
End
Begin VB.ComboBox Combo5
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 360
Left = 1680
Style = 2 'Dropdown List
TabIndex = 7
Top = 240
Width = 2055
End
Begin VB.Label Label21
AutoSize = -1 'True
BackColor = &H80000000&
Caption = "用户名称:"
Height = 180
Left = 480
TabIndex = 9
Top = 360
Width = 810
End
End
Begin VB.Frame Frame4
BackColor = &H80000000&
Caption = "添加用户"
Height = 2175
Left = 0
TabIndex = 0
Top = 0
Width = 3975
Begin VB.TextBox Text9
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 1680
TabIndex = 3
Text = "12345"
Top = 960
Width = 2055
End
Begin VB.TextBox Text8
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 1680
TabIndex = 2
Top = 360
Width = 2055
End
Begin VB.CommandButton Command2
Caption = "添加"
Height = 375
Left = 2760
TabIndex = 1
Top = 1560
Width = 855
End
Begin VB.Label Label20
AutoSize = -1 'True
BackColor = &H80000000&
Caption = "用户原始密码:"
Height = 180
Left = 240
TabIndex = 5
Top = 1080
Width = 1170
End
Begin VB.Label Label19
AutoSize = -1 'True
BackColor = &H80000000&
Caption = "用户名称:"
Height = 180
Left = 600
TabIndex = 4
Top = 480
Width = 810
End
End
End
Attribute VB_Name = "Form3"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub cmdExit_Click()
Unload Me
End Sub
Private Sub Command2_Click()
Dim rs1 As New ADODB.Recordset
If rs1.State Then rs1.Close
rs1.Open "select count(*) from user_info where 姓名='" & Trim(Text8.Text) & "'", CN, adOpenStatic, adLockOptimistic
If rs1.Fields(0) > 0 Then
MsgBox "用户已经存在! 请改用户名称!", , "系统提示"
Text8.Text = ""
Exit Sub
End If
If rs1.State Then rs1.Close
rs1.Open "select * from user_info", CN, adOpenStatic, adLockOptimistic
rs1.AddNew
rs1.Fields(0).Value = Trim(Text8.Text)
rs1.Fields(1).Value = Trim(Text9.Text)
rs1.Update
Combo5.AddItem Trim(Text8.Text)
MsgBox "用户添加成功!,初始密码为" & Text9.Text, , "系统提示"
Text8.Text = ""
End Sub
Private Sub Command3_Click()
CN.Execute "delete from user_info where 姓名='" & Trim(Combo5.Text) & "'"
Combo5.RemoveItem (Combo5.ListIndex)
MsgBox "操作已成功!", , "提示"
End Sub
Private Sub Command5_Click()
If Trim(Text10.Text) <> "" And Trim(Text11.Text) <> "" And Trim(Text12.Text) <> "" Then
If Trim(Text11.Text) <> Trim(Text12.Text) Then
MsgBox "新密码不对!"
Exit Sub
Else
Dim strSys As String
strSys = GetSetting(App.Title, "Settings", "syspassword", "admin")
If Trim(Text10.Text) <> Trim(strSys) Then
MsgBox "管理员旧密码不对!"
Exit Sub
Else
SaveSetting App.Title, "Settings", "syspassword", Trim(Text11.Text)
MsgBox "操作已成功!", , "提示"
End If
End If
End If
End Sub
Private Sub Form_Load()
Text8.Text = ""
Text10.Text = ""
Text11.Text = ""
Text12.Text = ""
Dim rs1 As New ADODB.Recordset
rs1.Open "select * from user_info", CN, adOpenStatic, adLockOptimistic
Combo5.Clear
While Not rs1.EOF
If Not IsNull(rs1.Fields(0)) Then Combo5.AddItem Trim(rs1.Fields(0))
rs1.MoveNext
Wend
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -