www.pudn.com > xj1.rar > Form4.dat, change:2008-05-31,size:29618b


选择题窗体代码 
 
VERSION 5.00 
Begin VB.Form Form4  
   BorderStyle     =   1  'Fixed Single 
   Caption         =   "实验考试系统" 
   ClientHeight    =   9855 
   ClientLeft      =   2610 
   ClientTop       =   1320 
   ClientWidth     =   11385 
   DrawWidth       =   2 
   LinkTopic       =   "Form4" 
   MaxButton       =   0   'False 
   ScaleHeight     =   9855 
   ScaleMode       =   0  'User 
   ScaleWidth      =   12000 
   StartUpPosition =   2  '屏幕中心 
   Begin VB.CommandButton Command2  
      Caption         =   "退出" 
      Height          =   375 
      Left            =   5880 
      TabIndex        =   71 
      Top             =   8520 
      Width           =   1095 
   End 
   Begin VB.Timer Timer2  
      Interval        =   1000 
      Left            =   10320 
      Top             =   8520 
   End 
   Begin VB.Frame Frame1  
      Height          =   1455 
      Index           =   9 
      Left            =   5880 
      TabIndex        =   46 
      Top             =   6720 
      Width           =   5295 
      Begin VB.OptionButton Option1  
         Caption         =   "Option10" 
         Height          =   255 
         Index           =   39 
         Left            =   2760 
         TabIndex        =   66 
         Top             =   1080 
         Width           =   2535 
      End 
      Begin VB.OptionButton Option1  
         Caption         =   "Option10" 
         Height          =   255 
         Index           =   38 
         Left            =   2760 
         TabIndex        =   65 
         Top             =   720 
         Width           =   2415 
      End 
      Begin VB.OptionButton Option1  
         Caption         =   "Option10" 
         Height          =   255 
         Index           =   37 
         Left            =   120 
         TabIndex        =   64 
         Top             =   1080 
         Width           =   2655 
      End 
      Begin VB.OptionButton Option1  
         Caption         =   "Option10" 
         Height          =   255 
         Index           =   36 
         Left            =   120 
         TabIndex        =   57 
         Top             =   720 
         Width           =   2655 
      End 
      Begin VB.Label Label3  
         AutoSize        =   -1  'True 
         Height          =   180 
         Index           =   9 
         Left            =   120 
         TabIndex        =   54 
         Top             =   120 
         Width           =   90 
      End 
   End 
   Begin VB.Frame Frame1  
      Height          =   1575 
      Index           =   8 
      Left            =   5880 
      TabIndex        =   45 
      Top             =   5160 
      Width           =   5295 
      Begin VB.OptionButton Option1  
         Caption         =   "Option9" 
         Height          =   255 
         Index           =   35 
         Left            =   2760 
         TabIndex        =   63 
         Top             =   1200 
         Width           =   2295 
      End 
      Begin VB.OptionButton Option1  
         Caption         =   "Option9" 
         Height          =   300 
         Index           =   34 
         Left            =   2760 
         TabIndex        =   62 
         Top             =   840 
         Width           =   2415 
      End 
      Begin VB.OptionButton Option1  
         Caption         =   "Option9" 
         Height          =   255 
         Index           =   33 
         Left            =   120 
         TabIndex        =   61 
         Top             =   1200 
         Width           =   2535 
      End 
      Begin VB.OptionButton Option1  
         Caption         =   "Option9" 
         Height          =   255 
         Index           =   32 
         Left            =   120 
         TabIndex        =   56 
         Top             =   840 
         Width           =   2655 
      End 
      Begin VB.Label Label3  
         AutoSize        =   -1  'True 
         Height          =   180 
         Index           =   8 
         Left            =   120 
         TabIndex        =   53 
         Top             =   120 
         Width           =   90 
      End 
   End 
   Begin VB.Frame Frame1  
      Height          =   1575 
      Index           =   7 
      Left            =   5880 
      TabIndex        =   44 
      Top             =   3600 
      Width           =   5295 
      Begin VB.OptionButton Option1  
         Caption         =   "Option8" 
         Height          =   255 
         Index           =   31 
         Left            =   2760 
         TabIndex        =   60 
         Top             =   1200 
         Width           =   2415 
      End 
      Begin VB.OptionButton Option1  
         Caption         =   "Option8" 
         Height          =   255 
         Index           =   30 
         Left            =   2760 
         TabIndex        =   59 
         Top             =   840 
         Width           =   2535 
      End 
      Begin VB.OptionButton Option1  
         Caption         =   "Option8" 
         Height          =   255 
         Index           =   29 
         Left            =   120 
         TabIndex        =   58 
         Top             =   1200 
         Width           =   2535 
      End 
      Begin VB.OptionButton Option1  
         Caption         =   "Option8" 
         Height          =   255 
         Index           =   28 
         Left            =   120 
         TabIndex        =   55 
         Top             =   840 
         Width           =   2535 
      End 
      Begin VB.Label Label3  
         AutoSize        =   -1  'True 
         Height          =   180 
         Index           =   7 
         Left            =   120 
         TabIndex        =   52 
         Top             =   120 
         Width           =   90 
      End 
   End 
   Begin VB.Frame Frame1  
      Height          =   1335 
      Index           =   6 
      Left            =   5880 
      TabIndex        =   43 
      Top             =   2280 
      Width           =   5295 
      Begin VB.OptionButton Option1  
         Caption         =   "Option7" 
         Height          =   255 
         Index           =   27 
         Left            =   2760 
         TabIndex        =   51 
         Top             =   960 
         Width           =   2415 
      End 
      Begin VB.OptionButton Option1  
         Caption         =   "Option7" 
         Height          =   255 
         Index           =   26 
         Left            =   2760 
         TabIndex        =   50 
         Top             =   600 
         Width           =   2415 
      End 
      Begin VB.OptionButton Option1  
         Caption         =   "Option7" 
         Height          =   255 
         Index           =   25 
         Left            =   120 
         TabIndex        =   49 
         Top             =   960 
         Width           =   2535 
      End 
      Begin VB.OptionButton Option1  
         Caption         =   "Option7" 
         Height          =   255 
         Index           =   24 
         Left            =   120 
         TabIndex        =   48 
         Top             =   600 
         Width           =   2535 
      End 
      Begin VB.Label Label3  
         AutoSize        =   -1  'True 
         Height          =   180 
         Index           =   6 
         Left            =   120 
         TabIndex        =   47 
         Top             =   120 
         Width           =   90 
      End 
   End 
   Begin VB.Frame Frame1  
      Height          =   1575 
      Index           =   5 
      Left            =   5880 
      TabIndex        =   32 
      Top             =   600 
      Width           =   5295 
      Begin VB.OptionButton Option1  
         Caption         =   "Option6" 
         Height          =   255 
         Index           =   20 
         Left            =   120 
         TabIndex        =   41 
         Top             =   840 
         Width           =   2655 
      End 
      Begin VB.OptionButton Option1  
         Caption         =   "Option6" 
         Height          =   255 
         Index           =   21 
         Left            =   120 
         TabIndex        =   40 
         Top             =   1200 
         Width           =   2655 
      End 
      Begin VB.OptionButton Option1  
         Caption         =   "Option6" 
         Height          =   255 
         Index           =   22 
         Left            =   2760 
         TabIndex        =   39 
         Top             =   840 
         Width           =   2295 
      End 
      Begin VB.OptionButton Option1  
         Caption         =   "Option6" 
         Height          =   255 
         Index           =   23 
         Left            =   2760 
         TabIndex        =   38 
         Top             =   1200 
         Width           =   2415 
      End 
      Begin VB.Label Label3  
         AutoSize        =   -1  'True 
         Height          =   180 
         Index           =   5 
         Left            =   120 
         TabIndex        =   42 
         Top             =   120 
         Width           =   90 
      End 
   End 
   Begin VB.Frame Frame1  
      Height          =   1455 
      Index           =   4 
      Left            =   120 
      TabIndex        =   31 
      Top             =   6720 
      Width           =   5535 
      Begin VB.OptionButton Option1  
         Caption         =   "Option5" 
         Height          =   255 
         Index           =   16 
         Left            =   240 
         TabIndex        =   36 
         Top             =   720 
         Width           =   2535 
      End 
      Begin VB.OptionButton Option1  
         Caption         =   "Option5" 
         Height          =   255 
         Index           =   17 
         Left            =   240 
         TabIndex        =   35 
         Top             =   1080 
         Width           =   2535 
      End 
      Begin VB.OptionButton Option1  
         Caption         =   "Option5" 
         Height          =   255 
         Index           =   18 
         Left            =   2880 
         TabIndex        =   34 
         Top             =   720 
         Width           =   2535 
      End 
      Begin VB.OptionButton Option1  
         Caption         =   "Option5" 
         Height          =   255 
         Index           =   19 
         Left            =   2880 
         TabIndex        =   33 
         Top             =   1080 
         Width           =   2535 
      End 
      Begin VB.Label Label3  
         AutoSize        =   -1  'True 
         Height          =   180 
         Index           =   4 
         Left            =   120 
         TabIndex        =   37 
         Top             =   120 
         Width           =   90 
      End 
   End 
   Begin VB.Frame Frame1  
      Height          =   1575 
      Index           =   3 
      Left            =   120 
      TabIndex        =   25 
      Top             =   5160 
      Width           =   5535 
      Begin VB.OptionButton Option1  
         Caption         =   "Option4" 
         Height          =   255 
         Index           =   12 
         Left            =   240 
         TabIndex        =   29 
         Top             =   840 
         Width           =   2655 
      End 
      Begin VB.OptionButton Option1  
         Caption         =   "Option4" 
         Height          =   255 
         Index           =   13 
         Left            =   240 
         TabIndex        =   28 
         Top             =   1200 
         Width           =   2655 
      End 
      Begin VB.OptionButton Option1  
         Caption         =   "Option4" 
         Height          =   255 
         Index           =   14 
         Left            =   2880 
         TabIndex        =   27 
         Top             =   840 
         Width           =   2535 
      End 
      Begin VB.OptionButton Option1  
         Caption         =   "Option4" 
         Height          =   255 
         Index           =   15 
         Left            =   2880 
         TabIndex        =   26 
         Top             =   1200 
         Width           =   2535 
      End 
      Begin VB.Label Label3  
         AutoSize        =   -1  'True 
         Height          =   180 
         Index           =   3 
         Left            =   120 
         TabIndex        =   30 
         Top             =   120 
         Width           =   90 
      End 
   End 
   Begin VB.Frame Frame1  
      Height          =   1575 
      Index           =   2 
      Left            =   120 
      TabIndex        =   19 
      Top             =   3600 
      Width           =   5535 
      Begin VB.OptionButton Option1  
         Caption         =   "Option3" 
         Height          =   255 
         Index           =   8 
         Left            =   240 
         TabIndex        =   23 
         Top             =   840 
         Width           =   2655 
      End 
      Begin VB.OptionButton Option1  
         Caption         =   "Option3" 
         Height          =   255 
         Index           =   9 
         Left            =   240 
         TabIndex        =   22 
         Top             =   1200 
         Width           =   2655 
      End 
      Begin VB.OptionButton Option1  
         Caption         =   "Option3" 
         Height          =   255 
         Index           =   10 
         Left            =   2880 
         TabIndex        =   21 
         Top             =   840 
         Width           =   2655 
      End 
      Begin VB.OptionButton Option1  
         Caption         =   "Option3" 
         Height          =   255 
         Index           =   11 
         Left            =   2880 
         TabIndex        =   20 
         Top             =   1200 
         Width           =   2535 
      End 
      Begin VB.Label Label3  
         AutoSize        =   -1  'True 
         Height          =   180 
         Index           =   2 
         Left            =   120 
         TabIndex        =   24 
         Top             =   120 
         Width           =   90 
      End 
   End 
   Begin VB.Frame Frame1  
      Height          =   1455 
      Index           =   1 
      Left            =   120 
      TabIndex        =   13 
      Top             =   2160 
      Width           =   5535 
      Begin VB.OptionButton Option1  
         Height          =   300 
         Index           =   4 
         Left            =   240 
         TabIndex        =   17 
         Top             =   720 
         Width           =   2535 
      End 
      Begin VB.OptionButton Option1  
         Height          =   300 
         Index           =   5 
         Left            =   240 
         TabIndex        =   16 
         Top             =   1080 
         Width           =   1215 
      End 
      Begin VB.OptionButton Option1  
         Height          =   255 
         Index           =   6 
         Left            =   2880 
         TabIndex        =   15 
         Top             =   720 
         Width           =   2535 
      End 
      Begin VB.OptionButton Option1  
         Height          =   255 
         Index           =   7 
         Left            =   2880 
         TabIndex        =   14 
         Top             =   1080 
         Width           =   2535 
      End 
      Begin VB.Label Label3  
         AutoSize        =   -1  'True 
         Height          =   180 
         Index           =   1 
         Left            =   120 
         TabIndex        =   18 
         Top             =   120 
         Width           =   90 
      End 
   End 
   Begin VB.Frame Frame1  
      Height          =   1575 
      Index           =   0 
      Left            =   120 
      TabIndex        =   7 
      Top             =   600 
      Width           =   5535 
      Begin VB.OptionButton Option1  
         Height          =   255 
         Index           =   0 
         Left            =   240 
         TabIndex        =   11 
         Top             =   840 
         Width           =   2655 
      End 
      Begin VB.OptionButton Option1  
         Height          =   255 
         Index           =   1 
         Left            =   240 
         TabIndex        =   10 
         Top             =   1200 
         Width           =   2655 
      End 
      Begin VB.OptionButton Option1  
         Height          =   255 
         Index           =   2 
         Left            =   2880 
         TabIndex        =   9 
         Top             =   840 
         Width           =   2535 
      End 
      Begin VB.OptionButton Option1  
         Height          =   255 
         Index           =   3 
         Left            =   2880 
         TabIndex        =   8 
         Top             =   1200 
         Width           =   2535 
      End 
      Begin VB.Label Label3  
         AutoSize        =   -1  'True 
         Height          =   180 
         Index           =   0 
         Left            =   120 
         TabIndex        =   12 
         Top             =   120 
         Width           =   90 
      End 
   End 
   Begin VB.CommandButton Command1  
      Caption         =   "下一页" 
      Height          =   375 
      Left            =   4440 
      TabIndex        =   6 
      Top             =   8520 
      Width           =   1215 
   End 
   Begin VB.Timer Timer1  
      Interval        =   1000 
      Left            =   120 
      Top             =   8640 
   End 
   Begin VB.Label Label1  
      BeginProperty Font  
         Name            =   "宋体" 
         Size            =   12 
         Charset         =   134 
         Weight          =   700 
         Underline       =   0   'False 
         Italic          =   0   'False 
         Strikethrough   =   0   'False 
      EndProperty 
      ForeColor       =   &H000000FF& 
      Height          =   495 
      Index           =   3 
      Left            =   6480 
      TabIndex        =   70 
      Top             =   9120 
      Width           =   1335 
   End 
   Begin VB.Label Label2  
      Caption         =   "剩余时间" 
      BeginProperty Font  
         Name            =   "宋体" 
         Size            =   12 
         Charset         =   134 
         Weight          =   700 
         Underline       =   0   'False 
         Italic          =   0   'False 
         Strikethrough   =   0   'False 
      EndProperty 
      ForeColor       =   &H00FFFF00& 
      Height          =   255 
      Index           =   3 
      Left            =   5280 
      TabIndex        =   69 
      Top             =   9120 
      Width           =   1095 
   End 
   Begin VB.Label Label5  
      BeginProperty Font  
         Name            =   "宋体" 
         Size            =   14.25 
         Charset         =   134 
         Weight          =   700 
         Underline       =   0   'False 
         Italic          =   0   'False 
         Strikethrough   =   0   'False 
      EndProperty 
      ForeColor       =   &H000000FF& 
      Height          =   495 
      Left            =   5880 
      TabIndex        =   68 
      Top             =   120 
      Width           =   1935 
   End 
   Begin VB.Label Label4  
      BeginProperty Font  
         Name            =   "宋体" 
         Size            =   14.25 
         Charset         =   134 
         Weight          =   700 
         Underline       =   0   'False 
         Italic          =   0   'False 
         Strikethrough   =   0   'False 
      EndProperty 
      ForeColor       =   &H000000FF& 
      Height          =   495 
      Left            =   4080 
      TabIndex        =   67 
      Top             =   120 
      Width           =   1575 
   End 
   Begin VB.Label Label2  
      Caption         =   "现在时间" 
      BeginProperty Font  
         Name            =   "宋体" 
         Size            =   12 
         Charset         =   134 
         Weight          =   700 
         Underline       =   0   'False 
         Italic          =   0   'False 
         Strikethrough   =   0   'False 
      EndProperty 
      ForeColor       =   &H00FFFF00& 
      Height          =   255 
      Index           =   2 
      Left            =   2640 
      TabIndex        =   5 
      Top             =   9120 
      Width           =   1095 
   End 
   Begin VB.Label Label2  
      Caption         =   "结束时间" 
      BeginProperty Font  
         Name            =   "宋体" 
         Size            =   12 
         Charset         =   134 
         Weight          =   700 
         Underline       =   0   'False 
         Italic          =   0   'False 
         Strikethrough   =   0   'False 
      EndProperty 
      ForeColor       =   &H00FFFF00& 
      Height          =   255 
      Index           =   1 
      Left            =   7920 
      TabIndex        =   4 
      Top             =   9120 
      Width           =   1095 
   End 
   Begin VB.Label Label2  
      Caption         =   "开始时间" 
      BeginProperty Font  
         Name            =   "宋体" 
         Size            =   12 
         Charset         =   134 
         Weight          =   700 
         Underline       =   0   'False 
         Italic          =   0   'False 
         Strikethrough   =   0   'False 
      EndProperty 
      ForeColor       =   &H00FFFF00& 
      Height          =   255 
      Index           =   0 
      Left            =   120 
      TabIndex        =   3 
      Top             =   9120 
      Width           =   1095 
   End 
   Begin VB.Label Label1  
      BeginProperty Font  
         Name            =   "宋体" 
         Size            =   12 
         Charset         =   134 
         Weight          =   700 
         Underline       =   0   'False 
         Italic          =   0   'False 
         Strikethrough   =   0   'False 
      EndProperty 
      ForeColor       =   &H000000FF& 
      Height          =   495 
      Index           =   2 
      Left            =   3840 
      TabIndex        =   2 
      Top             =   9120 
      Width           =   1335 
   End 
   Begin VB.Label Label1  
      BeginProperty Font  
         Name            =   "宋体" 
         Size            =   12 
         Charset         =   134 
         Weight          =   700 
         Underline       =   0   'False 
         Italic          =   0   'False 
         Strikethrough   =   0   'False 
      EndProperty 
      ForeColor       =   &H000000FF& 
      Height          =   495 
      Index           =   1 
      Left            =   9120 
      TabIndex        =   1 
      Top             =   9120 
      Width           =   1575 
   End 
   Begin VB.Label Label1  
      BeginProperty Font  
         Name            =   "宋体" 
         Size            =   12 
         Charset         =   134 
         Weight          =   700 
         Underline       =   0   'False 
         Italic          =   0   'False 
         Strikethrough   =   0   'False 
      EndProperty 
      ForeColor       =   &H000000FF& 
      Height          =   375 
      Index           =   0 
      Left            =   1320 
      TabIndex        =   0 
      Top             =   9120 
      Width           =   1215 
   End 
   Begin VB.Menu file  
      Caption         =   "文件(&F)" 
      Begin VB.Menu unlogin  
         Caption         =   "注消登录" 
      End 
      Begin VB.Menu creat  
         Caption         =   "创建试题库" 
         Enabled         =   0   'False 
      End 
      Begin VB.Menu a  
         Caption         =   "-" 
      End 
      Begin VB.Menu exit  
         Caption         =   "退出" 
      End 
   End 
   Begin VB.Menu show  
      Caption         =   "显示(&A)" 
      Begin VB.Menu time  
         Caption         =   "系统时间" 
         Enabled         =   0   'False 
      End 
      Begin VB.Menu an  
         Caption         =   "-" 
      End 
      Begin VB.Menu daima  
         Caption         =   "源代码" 
         Begin VB.Menu local  
            Caption         =   "当前窗口" 
         End 
         Begin VB.Menu all  
            Caption         =   "所有窗口" 
         End 
      End 
   End 
   Begin VB.Menu cx  
      Caption         =   "查询(&C)" 
      Begin VB.Menu xinxi  
         Caption         =   "个人信息" 
      End 
      Begin VB.Menu cxcj  
         Caption         =   "查询成绩" 
      End 
   End 
   Begin VB.Menu shuoming  
      Caption         =   "说明(&S)" 
      Begin VB.Menu html  
         Caption         =   "网页说明" 
      End 
      Begin VB.Menu txt  
         Caption         =   "文本说明" 
      End 
   End 
   Begin VB.Menu help  
      Caption         =   "帮助(&H)" 
   End 
End 
Attribute VB_Name = "Form4" 
Attribute VB_GlobalNameSpace = False 
Attribute VB_Creatable = False 
Attribute VB_PredeclaredId = True 
Attribute VB_Exposed = False 
Dim rec As Xuezhe 
Dim rec1 As tiaokong 
Dim kaosheng As people 
Dim an1(1 To 10), an2(1 To 10) As String 
Dim hh, mm, ss 
 
 
  
   
Private Sub all_Click() 
'读取所有代码 
Call duma 
End Sub 
 
Private Sub Command1_Click() 
'检查是否有选择题没做 
For i = 0 To 9 
If Option1(i * 4).Value = False And Option1(i * 4 + 1).Value = False And Option1(i * 4 + 2).Value = False And Option1(i * 4 + 3).Value = False Then 
MsgBox "你还有选择题目没有做", vbInformation, "提醒" 
 Exit Sub 
 End If 
Next i 
 
'保存所做的答案和标准答案 
For j = 1 To 10 
If Option1(j * 4 - 4).Value = True Then 
an2(j) = "A" 
ElseIf Option1(j * 4 - 3).Value = True Then 
an2(j) = "B" 
ElseIf Option1(j * 4 - 2).Value = True Then 
an2(j) = "C" 
ElseIf Option1(j * 4 - 1).Value = True Then 
an2(j) = "D" 
End If 
Next j 
 
'将答案写入文件保存 
On Error GoTo err 
Open "data\answer.tmp" For Output As #3 
Open "data\answer.tmp1" For Output As #4 
For j = 1 To 10 
Print #3, an1(j) 
Print #4, an2(j) 
Next j 
Close #3 
Close #4 
score = 0 
For j = 1 To 10 
If an1(j) = an2(j) Then 
score = score + 5 
End If 
Next j 
 
err: If err.Number = 70 Then MsgBox "无法写入文件,请确认文件磁盘是否写保护或写满,考试可继续...", vbInformation, "提醒" 
 
Load Form5 
Form5.show 
'传递选择题分数,姓名学号,及各项时间 
Form5.Label3.Caption = score 
Form5.Label4.Caption = Label4.Caption 
Form5.Label5.Caption = Label5.Caption 
Form5.Label1(13).Caption = Label1(3).Caption 
Form5.Label1(10).Caption = Label1(2).Caption 
Form5.Label1(11).Caption = Label1(1).Caption 
Form5.Label1(12).Caption = Label1(0).Caption 
Me.Hide 
 
 
End Sub 
 
 
 
 
Private Sub Command2_Click() 
'退出考试 
If MsgBox("确认退出考试,若退出本次考试将无效?", vbOKCancel, "实验考试系统") = vbOK Then 
End 
Else 
Cancel = 1 
End If 
End Sub 
 
Private Sub cxcj_Click() 
'查看个人信息 
Call xinxi_Click 
Form2.Label6.ForeColor = vbRed '突出显示成绩(红色标签) 
End Sub 
 
Private Sub exit_Click() 
'退出 
Call Command2_Click 
End Sub 
 
Private Sub Form_Load() 
Dim time, time2 As String 
Dim time1 As String 
Dim h, m, s As Integer 
hh = 0: mm = 59: ss = 59 
 
time = Now() 
'时间显示 
Label1(0).Caption = addtime(time, 0) 
Label1(1).Caption = addtime(time, 1) 
Label1(2).Caption = addtime(Now(), 0) 
Label1(3).Caption = "01:00:00" 
Static n As Integer 
 
Dim score As Integer 
 
'读入选择题,并保存答案 
On Error GoTo err 
Dim tihao(1 To 10) As Integer 
Open "data\shiti1.dat" For Random As #2 Len = Len(rec) 
For i = 1 To 10 
tihao(i) = Int(Rnd * (LOF(2) / Len(rec))) + 1 
Get #2, tihao(i), rec 
Label3(i - 1).Caption = Str(i) + ". " + rec.Question 
Option1(i * 4 - 4).Caption = rec.a 
Option1(i * 4 - 3).Caption = rec.B 
Option1(i * 4 - 2).Caption = rec.C 
Option1(i * 4 - 1).Caption = rec.D 
buf = rec.Answer 
an1(i) = rec.Answer 
Next i 
Close #2 
err: 
If err.Number = 53 Then 
MsgBox "试题库文件不存在,可能被移动或删除!", vbInformation, "实验考试系统" 
End 
End If 
End Sub 
 
 
 
Private Sub help_Click() 
MsgBox "无可用帮助,请见使用说明!", vbOKOnly, "实验考试系统" 
End Sub 
 
Private Sub html_Click() 
'打开网页说明 
Call shoum1 
End Sub 
 
Private Sub local_Click() 
'显示当前窗体代码 
Form7.show 
Form7.Label2.Caption = "data\form4.dat" 
Call dudaima 
End Sub 
 
Private Sub txt_Click() 
'打开文本说明 
Call shuom 
End Sub 
 
Private Sub unlogin_Click() 
'注销登录 
If MsgBox("确认退出考试,若退出本次考试将无效?", vbOKCancel, "实验考试系统") = vbOK Then 
Form1.show 
Unload Me 
Else 
Cancel = 1 
End If 
End Sub 
 
Private Sub Timer1_Timer() 
'动态显示时间 
Label1(2).Caption = addtime(Now(), 0) 
End Sub 
'倒计时一个小时 
Private Sub Timer2_Timer() 
s1 = IIf(ss < 10, "0" & ss, "" & ss) 
m1 = IIf(mm < 10, "0" & mm, "" & mm) 
h1 = IIf(hh < 10, "0" & hh, "" & hh) 
Label1(3).Caption = h1 + ":" + m1 + ":" + s1 
ss = ss - 1 
If Label1(3).Caption = "00:15:00" Then MsgBox "你还有十五分钟的时间", vbInformation, "实验考试系统" 
If ss = -1 And mm > 0 Then 
mm = mm - 1 
ss = 59 
End If 
If mm = 0 And hh > 0 Then 
hh = hh - 1 
mm = 59 
ss = 59 
End If 
End Sub 
 
 
Private Sub xinxi_Click() 
'得到学号 
xuehao = Right(Label5.Caption, 6) 
Form2.show 
'读入个人信息 
Open "data\ksxx.dat" For Random As #1 Len = Len(kaosheng) 
For i = 1 To LOF(1) \ Len(kaosheng) 
Get #1, i, kaosheng 
If RTrim(kaosheng.xuehao) = RTrim(xuehao) Then 
Form2.Text1(1).Text = kaosheng.xuehao 
Form2.Text1(0).Text = kaosheng.xingming 
Form2.Text1(2).Text = kaosheng.zhunkaozheng 
Form2.Text1(3).Text = kaosheng.age 
Form2.Text1(4).Text = kaosheng.sex 
Form2.Text1(5).Text = kaosheng.score 
Exit For 
End If 
Next i 
Close #1 
Form2.Command3.Enabled = False 
Form2.unlogin.Enabled = False 
End Sub