📄 教师人员管理.frm
字号:
VERSION 5.00
Begin VB.Form Form4
Caption = "教师人员管理"
ClientHeight = 4020
ClientLeft = 2010
ClientTop = 1350
ClientWidth = 5040
LinkTopic = "Form4"
ScaleHeight = 4020
ScaleWidth = 5040
StartUpPosition = 2 '屏幕中心
Begin VB.CommandButton Command7
Caption = "清空"
Enabled = 0 'False
Height = 495
Left = 2160
TabIndex = 13
Top = 3240
Width = 1335
End
Begin VB.CommandButton Command6
Caption = "确定"
Enabled = 0 'False
Height = 495
Left = 600
TabIndex = 12
Top = 3240
Width = 1335
End
Begin VB.TextBox Text3
Enabled = 0 'False
Height = 270
IMEMode = 3 'DISABLE
Left = 1320
PasswordChar = "*"
TabIndex = 10
Top = 2640
Width = 2175
End
Begin VB.TextBox Text2
Enabled = 0 'False
Height = 270
IMEMode = 3 'DISABLE
Left = 1320
PasswordChar = "*"
TabIndex = 9
Top = 2280
Width = 2175
End
Begin VB.TextBox Text1
Enabled = 0 'False
Height = 270
Left = 1320
TabIndex = 8
Top = 1920
Width = 2175
End
Begin VB.Frame Frame1
Height = 1695
Left = 120
TabIndex = 0
Top = 0
Width = 4695
Begin VB.CommandButton Command1
Caption = "添加教师"
Height = 495
Left = 240
TabIndex = 5
Top = 240
Width = 1215
End
Begin VB.CommandButton Command2
Caption = "删除教师"
Height = 495
Left = 1680
TabIndex = 4
Top = 240
Width = 1215
End
Begin VB.CommandButton Command3
Caption = "改教师密码"
Height = 495
Left = 240
TabIndex = 3
Top = 960
Width = 1215
End
Begin VB.CommandButton Command4
Caption = "清空教师"
Height = 495
Left = 1680
TabIndex = 2
Top = 960
Width = 1215
End
Begin VB.CommandButton Command5
Caption = "退出教师管理"
Height = 495
Left = 3120
TabIndex = 1
Top = 240
Width = 1335
End
Begin VB.Label Label4
Height = 495
Left = 3120
TabIndex = 14
Top = 960
Width = 1335
End
End
Begin VB.Label Label3
Caption = "确认密码:"
Height = 255
Left = 240
TabIndex = 11
Top = 2640
Width = 975
End
Begin VB.Label Label2
Caption = "教师密码:"
Height = 255
Left = 240
TabIndex = 7
Top = 2280
Width = 975
End
Begin VB.Label Label1
Caption = "教师姓名:"
Height = 255
Left = 240
TabIndex = 6
Top = 1920
Width = 975
End
End
Attribute VB_Name = "Form4"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private Sub Command1_Click()
ik = 11
Text1.Enabled = True
Text2.Enabled = True
Text3.Enabled = True
Command6.Enabled = True
Command7.Enabled = True
Label4.Caption = Command1.Caption
Text1.SetFocus
End Sub
Private Sub Command2_Click()
ik = 12
Text1.Enabled = True
Text2.Enabled = False
Text3.Enabled = False
Command6.Enabled = True
Command7.Enabled = True
Label4.Caption = Command2.Caption
Text1.SetFocus
End Sub
Private Sub Command3_Click()
ik = 13
Text1.Enabled = True
Text2.Enabled = True
Text3.Enabled = True
Command6.Enabled = True
Command7.Enabled = True
Label4.Caption = Command3.Caption
Text1.SetFocus
End Sub
Private Sub Command4_Click()
ik = 14
Command6.Enabled = True
Label4.Caption = Command4.Caption
Command6.SetFocus
End Sub
Private Sub Command5_Click()
Form1.Visible = True
Form1.SetFocus
Unload Me
End Sub
Private Sub Command6_Click()
Select Case ik
Case 11
'添加教师
If Text3.Text = Text2.Text Then
Open App.Path & "\..\jiao.dat" For Append As #11
Print #11, textpass(Trim(Text1.Text)) & Chr(16) & Chr(17)
Print #11, textpass(Trim(Text2.Text)) & Chr(16) & Chr(17)
Close #11
MsgBox "添加教师成功"
Text1.Enabled = False
Text2.Enabled = False
Text3.Enabled = False
Command6.Enabled = False
Command7.Enabled = False
Else
MsgBox "两次密码不相同!"
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text1.SetFocus
Exit Sub
End If
ik = 0
'
Case 12
'删除教师
Open App.Path & "\..\jiao.dat" For Binary As #12
bytemp = delj(Text1.Text, 12, "")
If bytemp = 0 Then
MsgBox "要删除的教师不存在!"
Text1.Text = ""
Text1.SetFocus
Exit Sub
Else
MsgBox "删除的教师成功!"
End If
ik = 0
Case 13
'改教师密码
If Text3.Text = Text2.Text Then
Open App.Path & "\..\jiao.dat" For Binary As #12
bytemp = delj(Text1.Text, 12, Text2.Text)
If bytemp = 0 Then
MsgBox "教师不存在!"
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text1.SetFocus
ik = 0
Exit Sub
Else
MsgBox "改教师密码成功"
End If
Else
MsgBox "两次密码不相同!"
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text1.SetFocus
End If
ik = 0
Case 14
'清空教师
Open App.Path & "\..\jiao.dat" For Output As #12
Close #12
MsgBox "清空教师成功"
End Select
Label4.Caption = ""
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text1.Enabled = False
Text2.Enabled = False
Text3.Enabled = False
Command6.Enabled = False
Command7.Enabled = False
End Sub
Private Sub Command7_Click()
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text1.SetFocus
End Sub
Private Sub Form_Unload(Cancel As Integer)
Form1.Visible = True
Form1.SetFocus
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -