📄 frmmain.frm
字号:
Strikethrough = 0 'False
EndProperty
ForeColor = &H00C00000&
Height = 360
Left = 2520
TabIndex = 2
Top = 6285
Width = 1875
End
Begin VB.Label LabCode
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "1234567"
BeginProperty Font
Name = "楷体_GB2312"
Size = 18
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H000000C0&
Height = 360
Left = 4215
TabIndex = 1
Top = 6300
Width = 1365
End
Begin VB.Image Imgks1
Height = 495
Left = 7320
Picture = "FrmMain.frx":1232C
Stretch = -1 'True
Top = 2520
Visible = 0 'False
Width = 495
End
Begin VB.Image Imgseach1
Height = 495
Left = 6555
Picture = "FrmMain.frx":164D2
Stretch = -1 'True
Top = 1350
Visible = 0 'False
Width = 495
End
Begin VB.Image Imgseach0
Height = 495
Left = 5910
Picture = "FrmMain.frx":19B14
Stretch = -1 'True
Top = 1530
Visible = 0 'False
Width = 495
End
Begin VB.Image ImgMM0
Height = 495
Left = 7140
Picture = "FrmMain.frx":1D104
Stretch = -1 'True
Top = 1620
Visible = 0 'False
Width = 495
End
Begin VB.Image Imgmm1
Height = 495
Left = 7920
Picture = "FrmMain.frx":20EC1
Stretch = -1 'True
Top = 1800
Visible = 0 'False
Width = 495
End
Begin VB.Image ImgKS
Height = 2010
Left = 8970
MouseIcon = "FrmMain.frx":24B25
MousePointer = 99 'Custom
Picture = "FrmMain.frx":24F67
Top = 600
Width = 2010
End
Begin VB.Image ImgMM
Height = 2010
Left = 7545
MouseIcon = "FrmMain.frx":291E4
MousePointer = 99 'Custom
Picture = "FrmMain.frx":29626
Top = 5775
Width = 2010
End
Begin VB.Image ImgSeach
Height = 2010
Left = 8700
MouseIcon = "FrmMain.frx":2D3E3
MousePointer = 99 'Custom
Picture = "FrmMain.frx":2D825
Top = 3240
Width = 2010
End
Begin VB.Label LabExit
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "退出"
BeginProperty Font
Name = "楷体_GB2312"
Size = 21.75
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00103CFF&
Height = 435
Left = 10605
MouseIcon = "FrmMain.frx":30E15
MousePointer = 99 'Custom
TabIndex = 0
Top = 7905
Width = 945
End
Begin VB.Image ImgExit
Height = 1005
Left = 10485
MouseIcon = "FrmMain.frx":31257
MousePointer = 99 'Custom
Picture = "FrmMain.frx":31699
Stretch = -1 'True
Top = 7155
Width = 1125
End
Begin VB.Label LabXinXiB
Alignment = 2 'Center
BackStyle = 0 'Transparent
Caption = "华录影音考试系统客户端"
BeginProperty Font
Name = "楷体_GB2312"
Size = 26.25
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FF0000&
Height = 660
Left = 600
TabIndex = 13
Top = 720
Width = 8025
End
Begin VB.Image Imgks0
Height = 495
Left = 6030
Picture = "FrmMain.frx":321C1
Stretch = -1 'True
Top = 735
Visible = 0 'False
Width = 495
End
End
Attribute VB_Name = "FrmMain"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private Sub Form_Load()
' PicXinXi.Picture
Dim adoRS As Recordset
Set adoRS = New Recordset
adoRS.CursorLocation = adUseClient
adoRS.Open "danwei", ConnString, adOpenStatic, adLockOptimistic
' If Not adoRS.EOF Then
' If adoRS.Fields("name").Value <> "" Then
'' LabXinXi.Caption = adoRS.Fields("name").Value + "考试系统"
' LabXinXiB.Caption = LabXinXi.Caption
' End If
' End If
adoRS.Close
Dim sql As String
sql = "select * from kaosheng where id=" & StudentID
adoRS.Open sql, ConnString, adOpenStatic, adLockOptimistic
If adoRS.EOF = True Then
MsgBox "数据库读取错误!"
Set adoRS = Nothing
Exit Sub
End If
LabName.Caption = adoRS.Fields("name").Value
LabSex.Caption = adoRS.Fields("sex").Value
LabYear.Caption = adoRS.Fields("ryear").Value & "年"
LabCode.Caption = adoRS.Fields("code").Value
Set adoRS = Nothing
End Sub
'设置显示的属性
Sub SetVisible(ByVal TF As Boolean)
' Label1.Visible = TF
Label2.Visible = TF
Label3.Visible = TF
Label5.Visible = TF
Label7.Visible = TF
LabName.Visible = TF
LabYear.Visible = TF
LabSex.Visible = TF
LabCode.Visible = TF
ImgMM.Enabled = TF
LabOld.Visible = Not TF
LabNew.Visible = Not TF
LabNew1.Visible = Not TF
TXTOldPass.Visible = Not TF
TxTNewPass.Visible = Not TF
TxTNewPass1.Visible = Not TF
LabOK.Visible = Not TF
LabEsc.Visible = Not TF
TXTOldPass.Text = ""
TxTNewPass.Text = ""
TxTNewPass1.Text = ""
End Sub
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, x As Single, y As Single)
ImgSeach.Picture = Imgseach0.Picture
ImgKS.Picture = Imgks0.Picture
ImgMM.Picture = ImgMM0.Picture
LabExit.ForeColor = &H103CFF
End Sub
Private Sub Form_Unload(Cancel As Integer)
If MsgBox("你真的要退出系统吗?", vbYesNo, "问题") = vbNo Then
Cancel = 1
End If
' FrmClient.M_Login.Enabled = True
End
End Sub
Private Sub imgExit_Click()
Unload Me
End
End Sub
Private Sub ImgExit_MouseMove(Button As Integer, Shift As Integer, x As Single, y As Single)
LabExit.ForeColor = RGB(0, 0, 255)
End Sub
Private Sub ImgKS_Click()
'读题目
'判断是否发卷开考
If StartYN() = False Then
MsgBox "对不起,还没开始考试!"
Exit Sub
End If
FrmKaoShi.Show 1
End Sub
Private Sub ImgKS_MouseMove(Button As Integer, Shift As Integer, x As Single, y As Single)
ImgKS.Picture = Imgks1.Picture
End Sub
Private Sub ImgMM_Click()
SetVisible False
End Sub
Private Sub ImgMM_MouseMove(Button As Integer, Shift As Integer, x As Single, y As Single)
ImgMM.Picture = Imgmm1.Picture
End Sub
Private Sub ImgSeach_Click()
'检查是否考过试
Dim adoRS As Recordset
Set adoRS = New Recordset
adoRS.CursorLocation = adUseClient
adoRS.Open "select studentid from score where complete='T' and studentid=" & StudentID, ConnString, adOpenStatic, adLockOptimistic
If adoRS.EOF Then
MsgBox "你没有参加过考试,或者你所考的试卷还没有判完!"
Exit Sub
End If
FrmLookFor.Show 1
End Sub
Private Sub ImgSeach_MouseMove(Button As Integer, Shift As Integer, x As Single, y As Single)
ImgSeach.Picture = Imgseach1.Picture
End Sub
Private Sub LabEsc_Click()
SetVisible True
End Sub
Private Sub LabExit_Click()
Unload Me
End Sub
Private Sub LabExit_MouseMove(Button As Integer, Shift As Integer, x As Single, y As Single)
LabExit.ForeColor = RGB(0, 0, 255)
End Sub
Private Sub LabOK_Click()
Dim Pass As String
If TxTNewPass.Text <> TxTNewPass1.Text Then
MsgBox "你两次输入的密码不相等,请重新输入!"
TxTNewPass.SetFocus
SendKeys "{home}+{end}"
Exit Sub
End If
Dim adoRS As Recordset
Set adoRS = New Recordset
adoRS.CursorLocation = adUseClient
adoRS.Open "select pass from kaosheng where id=" & StudentID, ConnString, adOpenStatic, adLockOptimistic
If adoRS.EOF = True Then
MsgBox "数据库读取错误!"
Set adoRS = Nothing
Exit Sub
End If
Pass = adoRS.Fields(0).Value
Set adoRS = Nothing
If TXTOldPass.Text <> Pass Then
MsgBox "对不起,你输入的密码不正确,请重新输入!"
SendKeys "{home}+{end}"
Exit Sub
End If
'更改密码
Dim RemoteConn As Connection
Set RemoteConn = New Connection
RemoteConn.Open ConnString '打开连接
RemoteConn.Execute "update kaosheng set pass='" + TxTNewPass.Text + "' where id=" & StudentID
Set RemoteConn = Nothing
MsgBox "密码修改成功,请牢记!"
SetVisible True
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -