www.pudn.com > zzksxt.rar > Form1.frm, change:2007-04-15,size:45793b


VERSION 5.00 
Object = "{248DD890-BB45-11CF-9ABC-0080C7E7B78D}#1.0#0"; "MSWINSCK.OCX" 
Object = "{0D452EE1-E08F-101A-852E-02608C4D0BB4}#2.0#0"; "FM20.DLL" 
Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "COMDLG32.OCX" 
Begin VB.Form Form1  
   BorderStyle     =   0  'None 
   Caption         =   "星零考试系统客户端 版本0.1" 
   ClientHeight    =   7860 
   ClientLeft      =   0 
   ClientTop       =   0 
   ClientWidth     =   11190 
   ForeColor       =   &H00000000& 
   Icon            =   "Form1.frx":0000 
   LinkTopic       =   "Form1" 
   ScaleHeight     =   7860 
   ScaleWidth      =   11190 
   StartUpPosition =   1  '所有者中心 
   Begin 星零考试系统客户端.XP_ProgressBar XPPBR1  
      Height          =   120 
      Left            =   0 
      TabIndex        =   25 
      Top             =   2400 
      Width           =   5295 
      _ExtentX        =   9340 
      _ExtentY        =   212 
      Color           =   12937777 
   End 
   Begin VB.Timer Timer1  
      Enabled         =   0   'False 
      Interval        =   50 
      Left            =   1920 
      Top             =   2160 
   End 
   Begin VB.PictureBox PictureBG1  
      Appearance      =   0  'Flat 
      BackColor       =   &H80000005& 
      BorderStyle     =   0  'None 
      ForeColor       =   &H80000008& 
      Height          =   4215 
      Left            =   120 
      ScaleHeight     =   4215 
      ScaleWidth      =   7455 
      TabIndex        =   12 
      Top             =   2520 
      Width           =   7455 
      Begin VB.PictureBox PictureQG1  
         Appearance      =   0  'Flat 
         BackColor       =   &H00FFFFC0& 
         BorderStyle     =   0  'None 
         ForeColor       =   &H80000008& 
         Height          =   5415 
         Left            =   0 
         ScaleHeight     =   5415 
         ScaleWidth      =   8415 
         TabIndex        =   13 
         Top             =   0 
         Width           =   8415 
         Begin VB.PictureBox Picture_panel  
            Appearance      =   0  'Flat 
            BackColor       =   &H00FFFFC0& 
            BorderStyle     =   0  'None 
            ForeColor       =   &H80000008& 
            Height          =   2415 
            Left            =   5160 
            ScaleHeight     =   2415 
            ScaleWidth      =   2295 
            TabIndex        =   21 
            Top             =   120 
            Width           =   2295 
            Begin VB.Label W_stnumber  
               AutoSize        =   -1  'True 
               BackStyle       =   0  'Transparent 
               Caption         =   "答错题数:" 
               BeginProperty Font  
                  Name            =   "宋体" 
                  Size            =   10.5 
                  Charset         =   134 
                  Weight          =   400 
                  Underline       =   0   'False 
                  Italic          =   0   'False 
                  Strikethrough   =   0   'False 
               EndProperty 
               ForeColor       =   &H00FF0000& 
               Height          =   210 
               Left            =   540 
               TabIndex        =   28 
               Top             =   1560 
               Width           =   945 
            End 
            Begin VB.Label R_stnumber  
               AutoSize        =   -1  'True 
               BackStyle       =   0  'Transparent 
               Caption         =   "答对题数:" 
               BeginProperty Font  
                  Name            =   "宋体" 
                  Size            =   10.5 
                  Charset         =   134 
                  Weight          =   400 
                  Underline       =   0   'False 
                  Italic          =   0   'False 
                  Strikethrough   =   0   'False 
               EndProperty 
               ForeColor       =   &H00FF0000& 
               Height          =   210 
               Left            =   540 
               TabIndex        =   27 
               Top             =   1200 
               Width           =   945 
            End 
            Begin VB.Label Count_stnumber  
               AutoSize        =   -1  'True 
               BackStyle       =   0  'Transparent 
               Caption         =   "总题数:" 
               BeginProperty Font  
                  Name            =   "宋体" 
                  Size            =   10.5 
                  Charset         =   134 
                  Weight          =   400 
                  Underline       =   0   'False 
                  Italic          =   0   'False 
                  Strikethrough   =   0   'False 
               EndProperty 
               ForeColor       =   &H00FF0000& 
               Height          =   210 
               Left            =   540 
               TabIndex        =   26 
               Top             =   840 
               Width           =   735 
            End 
            Begin VB.Label TIMECOUNT  
               AutoSize        =   -1  'True 
               BackStyle       =   0  'Transparent 
               Caption         =   "考试时间:" 
               BeginProperty Font  
                  Name            =   "宋体" 
                  Size            =   10.5 
                  Charset         =   134 
                  Weight          =   400 
                  Underline       =   0   'False 
                  Italic          =   0   'False 
                  Strikethrough   =   0   'False 
               EndProperty 
               ForeColor       =   &H00FF0000& 
               Height          =   210 
               Left            =   120 
               TabIndex        =   24 
               Top             =   120 
               Width           =   945 
            End 
            Begin VB.Label count_mark  
               AutoSize        =   -1  'True 
               BackStyle       =   0  'Transparent 
               Caption         =   "总分:" 
               BeginProperty Font  
                  Name            =   "宋体" 
                  Size            =   10.5 
                  Charset         =   134 
                  Weight          =   400 
                  Underline       =   0   'False 
                  Italic          =   0   'False 
                  Strikethrough   =   0   'False 
               EndProperty 
               ForeColor       =   &H00FF0000& 
               Height          =   210 
               Left            =   540 
               TabIndex        =   23 
               Top             =   480 
               Width           =   525 
            End 
            Begin VB.Label score_label  
               AutoSize        =   -1  'True 
               BackStyle       =   0  'Transparent 
               Caption         =   "得分:" 
               BeginProperty Font  
                  Name            =   "宋体" 
                  Size            =   10.5 
                  Charset         =   134 
                  Weight          =   400 
                  Underline       =   0   'False 
                  Italic          =   0   'False 
                  Strikethrough   =   0   'False 
               EndProperty 
               ForeColor       =   &H00FF0000& 
               Height          =   210 
               Left            =   540 
               TabIndex        =   22 
               Top             =   1920 
               Width           =   525 
            End 
         End 
         Begin VB.Timer Timer2  
            Enabled         =   0   'False 
            Interval        =   1000 
            Left            =   3120 
            Top             =   2760 
         End 
         Begin 星零考试系统客户端.XpCheckBox Check1  
            Height          =   375 
            Index           =   0 
            Left            =   600 
            TabIndex        =   14 
            Top             =   1920 
            Visible         =   0   'False 
            Width           =   6135 
            _ExtentX        =   10821 
            _ExtentY        =   661 
            CheckBoxLook    =   3 
            Caption         =   "check1" 
            BackColor       =   16777152 
            BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}  
               Name            =   "宋体" 
               Size            =   12 
               Charset         =   134 
               Weight          =   700 
               Underline       =   0   'False 
               Italic          =   0   'False 
               Strikethrough   =   0   'False 
            EndProperty 
         End 
         Begin 星零考试系统客户端.XpCheckBox Check2  
            Height          =   375 
            Index           =   0 
            Left            =   600 
            TabIndex        =   15 
            Top             =   2280 
            Visible         =   0   'False 
            Width           =   6135 
            _ExtentX        =   10821 
            _ExtentY        =   661 
            CheckBoxLook    =   3 
            Caption         =   "Check2" 
            BackColor       =   16777152 
            BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}  
               Name            =   "宋体" 
               Size            =   12 
               Charset         =   134 
               Weight          =   700 
               Underline       =   0   'False 
               Italic          =   0   'False 
               Strikethrough   =   0   'False 
            EndProperty 
         End 
         Begin 星零考试系统客户端.XpCheckBox Check3  
            Height          =   375 
            Index           =   0 
            Left            =   600 
            TabIndex        =   16 
            Top             =   2640 
            Visible         =   0   'False 
            Width           =   6135 
            _ExtentX        =   10821 
            _ExtentY        =   661 
            CheckBoxLook    =   3 
            Caption         =   "Check3" 
            BackColor       =   16777152 
            BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}  
               Name            =   "宋体" 
               Size            =   12 
               Charset         =   134 
               Weight          =   700 
               Underline       =   0   'False 
               Italic          =   0   'False 
               Strikethrough   =   0   'False 
            EndProperty 
         End 
         Begin 星零考试系统客户端.XpCheckBox Check4  
            Height          =   375 
            Index           =   0 
            Left            =   600 
            TabIndex        =   17 
            Top             =   3000 
            Visible         =   0   'False 
            Width           =   6135 
            _ExtentX        =   10821 
            _ExtentY        =   661 
            CheckBoxLook    =   3 
            Caption         =   "Check4" 
            BackColor       =   16777152 
            BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}  
               Name            =   "宋体" 
               Size            =   12 
               Charset         =   134 
               Weight          =   700 
               Underline       =   0   'False 
               Italic          =   0   'False 
               Strikethrough   =   0   'False 
            EndProperty 
         End 
         Begin VB.Label Answer_R  
            AutoSize        =   -1  'True 
            BackStyle       =   0  'Transparent 
            Caption         =   "A" 
            BeginProperty Font  
               Name            =   "宋体" 
               Size            =   15 
               Charset         =   134 
               Weight          =   700 
               Underline       =   0   'False 
               Italic          =   0   'False 
               Strikethrough   =   0   'False 
            EndProperty 
            ForeColor       =   &H000000FF& 
            Height          =   300 
            Index           =   0 
            Left            =   2040 
            TabIndex        =   11 
            Top             =   120 
            Visible         =   0   'False 
            Width           =   165 
         End 
         Begin VB.Image Img_w  
            Height          =   480 
            Index           =   0 
            Left            =   120 
            Picture         =   "Form1.frx":F84A 
            Top             =   1080 
            Visible         =   0   'False 
            Width           =   480 
         End 
         Begin VB.Label ST_NAME  
            Alignment       =   2  'Center 
            AutoSize        =   -1  'True 
            BackStyle       =   0  'Transparent 
            Caption         =   "试卷名称" 
            BeginProperty Font  
               Name            =   "宋体" 
               Size            =   21.75 
               Charset         =   134 
               Weight          =   700 
               Underline       =   0   'False 
               Italic          =   0   'False 
               Strikethrough   =   0   'False 
            EndProperty 
            Height          =   435 
            Left            =   2820 
            TabIndex        =   20 
            Top             =   720 
            Width           =   1815 
         End 
         Begin VB.Label Label1  
            AutoSize        =   -1  'True 
            BackStyle       =   0  'Transparent 
            Caption         =   "Label1" 
            BeginProperty Font  
               Name            =   "宋体" 
               Size            =   12 
               Charset         =   134 
               Weight          =   700 
               Underline       =   0   'False 
               Italic          =   0   'False 
               Strikethrough   =   0   'False 
            EndProperty 
            Height          =   240 
            Index           =   0 
            Left            =   480 
            TabIndex        =   18 
            Top             =   480 
            Visible         =   0   'False 
            Width           =   810 
         End 
         Begin VB.Image Image1  
            Height          =   1455 
            Index           =   0 
            Left            =   840 
            Top             =   720 
            Width           =   1695 
         End 
      End 
   End 
   Begin VB.PictureBox Picture4  
      BackColor       =   &H00404040& 
      BorderStyle     =   0  'None 
      ForeColor       =   &H00808080& 
      Height          =   300 
      Left            =   0 
      ScaleHeight     =   300 
      ScaleWidth      =   11175 
      TabIndex        =   4 
      Top             =   2120 
      Width           =   11175 
      Begin VB.Label Label_cz  
         BackStyle       =   0  'Transparent 
         Caption         =   "操作信息:" 
         ForeColor       =   &H00FFFF00& 
         Height          =   195 
         Left            =   2520 
         TabIndex        =   10 
         Top             =   45 
         Width           =   975 
      End 
      Begin VB.Label LabelCZ  
         BackStyle       =   0  'Transparent 
         Caption         =   "未连接服务器,或服务器未启动,请稍候再试." 
         ForeColor       =   &H0000FFFF& 
         Height          =   195 
         Left            =   3390 
         TabIndex        =   9 
         Top             =   45 
         Width           =   5535 
      End 
      Begin VB.Label Label_Time  
         BackStyle       =   0  'Transparent 
         Caption         =   "考试剩余时间:     秒" 
         ForeColor       =   &H00FFFF00& 
         Height          =   195 
         Left            =   9120 
         TabIndex        =   8 
         Top             =   45 
         Width           =   1935 
      End 
      Begin VB.Label Labeltime  
         BackStyle       =   0  'Transparent 
         Caption         =   "1920" 
         ForeColor       =   &H0000FFFF& 
         Height          =   195 
         Left            =   10335 
         TabIndex        =   7 
         Top             =   45 
         Width           =   480 
      End 
      Begin VB.Label LabelID  
         BackStyle       =   0  'Transparent 
         Caption         =   "xhlbwb" 
         ForeColor       =   &H0000FFFF& 
         Height          =   195 
         Left            =   960 
         TabIndex        =   6 
         Top             =   45 
         Width           =   1335 
      End 
      Begin VB.Label Label_ID  
         BackStyle       =   0  'Transparent 
         Caption         =   "用户ID:" 
         ForeColor       =   &H00FFFF00& 
         Height          =   195 
         Left            =   240 
         TabIndex        =   5 
         Top             =   45 
         Width           =   735 
      End 
   End 
   Begin VB.PictureBox Picture1  
      BackColor       =   &H000000FF& 
      BorderStyle     =   0  'None 
      Height          =   375 
      Left            =   0 
      ScaleHeight     =   375 
      ScaleWidth      =   75 
      TabIndex        =   3 
      Top             =   0 
      Width           =   80 
   End 
   Begin VB.PictureBox Picture2  
      BackColor       =   &H000000FF& 
      BorderStyle     =   0  'None 
      Height          =   375 
      Left            =   480 
      ScaleHeight     =   375 
      ScaleWidth      =   75 
      TabIndex        =   2 
      Top             =   840 
      Width           =   80 
   End 
   Begin VB.PictureBox Picture3  
      BackColor       =   &H000000FF& 
      BorderStyle     =   0  'None 
      Height          =   70 
      Left            =   240 
      ScaleHeight     =   75 
      ScaleWidth      =   375 
      TabIndex        =   1 
      Top             =   120 
      Width           =   375 
   End 
   Begin 星零考试系统客户端.ACPRibbon ACPRibbon1  
      Height          =   2130 
      Left            =   0 
      TabIndex        =   0 
      Top             =   0 
      Width           =   11175 
      _ExtentX        =   19711 
      _ExtentY        =   3757 
   End 
   Begin MSWinsockLib.Winsock sckClient  
      Left            =   5160 
      Top             =   7440 
      _ExtentX        =   741 
      _ExtentY        =   741 
      _Version        =   393216 
   End 
   Begin MSComDlg.CommonDialog CommonDialog1  
      Left            =   840 
      Top             =   7320 
      _ExtentX        =   847 
      _ExtentY        =   847 
      _Version        =   393216 
   End 
   Begin VB.Image ImageTOP  
      Height          =   450 
      Left            =   8280 
      Picture         =   "Form1.frx":FE47 
      Top             =   3000 
      Visible         =   0   'False 
      Width           =   450 
   End 
   Begin VB.Image Imagemenu1  
      Height          =   210 
      Left            =   8400 
      Picture         =   "Form1.frx":FECE 
      Top             =   3600 
      Visible         =   0   'False 
      Width           =   210 
   End 
   Begin VB.Image ImageTAB1  
      Height          =   720 
      Left            =   8040 
      Picture         =   "Form1.frx":1012E 
      Top             =   4080 
      Width           =   720 
   End 
   Begin MSForms.ScrollBar VScroll1  
      Height          =   1095 
      Left            =   9240 
      TabIndex        =   19 
      Top             =   2760 
      Width           =   300 
      ForeColor       =   65535 
      BackColor       =   8421504 
      Size            =   "529;1931" 
      SmallChange     =   100 
      LargeChange     =   100 
   End 
   Begin VB.Line Line1  
      Visible         =   0   'False 
      X1              =   0 
      X2              =   9840 
      Y1              =   2450 
      Y2              =   2450 
   End 
End 
Attribute VB_Name = "Form1" 
Attribute VB_GlobalNameSpace = False 
Attribute VB_Creatable = False 
Attribute VB_PredeclaredId = True 
Attribute VB_Exposed = False 
Private Declare Function GetPrivateProfileString Lib "kernel32" Alias "GetPrivateProfileStringA" (ByVal lpApplicationName As String, ByVal lpKeyName As Any, ByVal lpDefault As String, ByVal lpReturnedString As String, ByVal nSize As Long, ByVal lpFileName As String) As Long 
Private Declare Function WritePrivateProfileString Lib "kernel32" Alias "WritePrivateProfileStringA" (ByVal lpApplicationName As String, ByVal lpKeyName As Any, ByVal lpString As Any, ByVal lpFileName As String) As Long 
 
Dim ListEXECLLOG As String '记录列表文件名 
Dim LISTMID '当前操作文件夹 
Dim firsttime As Boolean 
'Dim LoginName As String '登陆用户名 
Dim FileSent As Double '设定获取字符字节数 
Dim strdata As String  '获取到的字符 
Dim Filename     As String '文件名称 
Dim Filesize As Double '文件大小 
Dim Filecountsize As Double '文件当前总大小 
Dim imgxj As Boolean '续接 
Dim vscmod As Integer '使用下拉中的被某数整除中使用 
Dim down As Boolean '当前是否是获取文件状态 
Dim Create_Boolean As Boolean '是否已提取过试题 
Dim Computer_id As String '计算机ID编号,可作为快捷识别号 
Dim ServerIP As String '指向服务器端的IP地址 
Dim KS_TIME As Long '考试时间 
 
Private Sub ACPRibbon1_ButtonClick(ByVal ID As String, ByVal Caption As String) 
Select Case ID 
Case 1 '发出试题生成请求 
 If Timer2.Enabled = True Then 
  MsgBox "考试计时中.....", vbInformation, "执行无效" 
  Exit Sub 
 End If 
 sckClient.SendData "ASKFORQUESTIMONS|" & LoginName & vbCrLf 
 '清除必要文件 
  If Dir(App.Path & "\DATALIST\" & LoginName & ".txt", vbNormal) <> "" Then 
    Kill App.Path & "\DATALIST\" & LoginName & ".txt" 
  End If 
 If Dir(App.Path & "\DATALIST\" & LoginName & "_ASK.txt", vbNormal) <> "" Then 
    Kill App.Path & "\DATALIST\" & LoginName & "_ASK.txt" 
 End If 
 If Dir(App.Path & "\DATALIST\" & LoginName & "_answer.txt", vbNormal) <> "" Then 
    Kill App.Path & "\DATALIST\" & LoginName & "_answer.txt" 
 End If 
Case 2 '显示试题 
    If Dir(App.Path & "\DATALIST\" & LoginName & "_ASK.txt", vbNormal) <> "" Then 
    SHOW_ST 
    Else 
    MsgBox "试题文件不存在,请重新生成!", vbInformation, "提示" 
    End If 
Case 3 '进入调整字体 
    Exit Sub 
    Label_showfont 
Case 4 
 SAVE_KEY '保存答案 
 Filename = App.Path & "\DATALIST\" & LoginName & "_answer.txt" 
 sckClient.SendData "FILENAME|" & Mid(Filename, InStrRev(Filename, "\") + 1) & vbCrLf 
 Filesize = FileLen(Filename) 
 sckClient.SendData "FILESIZE|" & Filesize & vbCrLf 
 Timer2.Enabled = False 
 Labeltime = "0" 
Case 7 
 End 
End Select 
End Sub 
Private Sub SAVE_KEY() '保存答案 
Open App.Path & "\DATALIST\" & LoginName & "_answer.txt" For Append As #1 
 For i = 1 To Check1.Count - 1 
  If Check1(i).Value = 0 And Check2(i).Value = 0 And Check3(i).Value = 0 And Check4(i).Value = 0 Then 
   Print #1, "" 
  Else 
   If Check1(i).Value = 1 Then 
   Print #1, "A" 
   End If 
   If Check2(i).Value = 1 Then 
   Print #1, "B" 
   End If 
   If Check3(i).Value = 1 Then 
   Print #1, "C" 
   End If 
   If Check4(i).Value = 1 Then 
   Print #1, "D" 
   End If 
  End If 
 Next 
Close #1 
MsgBox "答案已保存" 
End Sub 
Private Sub SHOW_ST() 
If Create_Boolean = True Then 
Exit Sub 
End If 
Dim intFile As Integer 
Dim strinput As String 
Dim strst() As String 
Dim strstimg() As String 
Dim strtargetfile As String 
strtargetfile = App.Path & "\datalist\" & LoginName & "_ask.txt" 
intFile = FreeFile 
Filesize = FileLen(strtargetfile) 
             'If Dir(strtargetfile, vbNormal) <> "" Then 
             '   Kill strtargetfile 
             'End If 
Open strtargetfile For Binary As #1 
strinput = Space(Filesize) 
Get #intFile, , strinput 
strst = Split(strinput, vbCrLf) 
XPPBR1.Max = Int((UBound(strst) - 1) / 5) '除5得到实际的选择题数,每执行一题即加1 
XPPBR1.Min = 0 
'通过以上读取出文本文件的内容,并进行导入程序 
'ubound(strst)-1 是获取strst数组的总数并减1,获得分隔后文本的行数 
For i = 0 To UBound(strst) - 1 Step 5 
Load Label1(Label1.UBound + 1) 
If imgxj = False Then 
Label1(Label1.Count - 1).Top = Check4(Check4.Count - 1).Top + Check4(Check4.Count - 1).Height + 300 
Else 
Label1(Label1.Count - 1).Top = Image1(Image1.Count - 1).Top + Image1(Image1.Count - 1).Height + 300 
End If 
strstimg = Split(strst(i), "@") 
Label1(Label1.Count - 1).Caption = Mid(strstimg(0), 1, Len(strstimg(0)) - 1) 
If strstimg(1) <> "" Then '此处可能会有错误'UBound(strstimg) > 1 Then 
Load Image1(Image1.UBound + 1) 
Image1(Image1.Count - 1).Picture = LoadPicture(App.Path & Mid(strstimg(1), 5, Len(strstimg(1)) - 4)) 
Image1(Image1.Count - 1).Top = Label1(Label1.Count - 1).Top + Label1(Label1.Count - 1).Height + 100 
'Label1(Label1.Count - 1).Top = Image1(Image1.Count - 1).Top + (Image1(Image1.Count - 1).Height - Label1(Label1.Count - 1).Height) / 2 
Image1(Image1.Count - 1).Left = Label1(Label1.Count - 1).Left 
Image1(Image1.Count - 1).Visible = True 
imgxj = True 
Else 
imgxj = False 
End If 
Label1(Label1.Count - 1).Visible = True 
 
Load Check1(Check1.UBound + 1) 
If imgxj = False Then 
Check1(Check1.Count - 1).Top = Label1(Label1.Count - 1).Top + Label1(Label1.Count - 1).Height + 100 
Else 
Check1(Check1.Count - 1).Top = Image1(Image1.Count - 1).Top + Image1(Image1.Count - 1).Height + 100 
End If 
If Mid(strst(i + 1), 4, 4) = "BMP|" Then 
Load Image1(Image1.UBound + 1) 
Image1(Image1.Count - 1).Picture = LoadPicture(App.Path & Mid(strst(i + 1), 8, Len(strst(i + 1)) - 7)) 
Check1(Check1.Count - 1).Caption = Mid(strst(i + 1), 1, 3) 
Check1(Check1.Count - 1).Width = 615 
Image1(Image1.Count - 1).Left = Check1(Check1.Count - 1).Left + Check1(Check1.Count - 1).Width + 100 
Image1(Image1.Count - 1).Top = Check1(Check1.Count - 1).Top + Check1(Check1.Count - 1).Height + 100 
Check1(Check1.Count - 1).Top = Image1(Image1.Count - 1).Top + (Image1(Image1.Count - 1).Height - Check1(Check1.Count - 1).Height) / 2 
Image1(Image1.Count - 1).Visible = True 
Else 
Check1(Check1.Count - 1).Caption = strst(i + 1) 
imgxj = False 
End If 
Check1(Check1.Count - 1).Visible = True 
'******************************************* 
Load Check2(Check2.UBound + 1) 
If imgxj = False Then 
Check2(Check2.Count - 1).Top = Check1(Check1.Count - 1).Top + Check1(Check1.Count - 1).Height + 100 
Else 
Check2(Check2.Count - 1).Top = Image1(Image1.Count - 1).Top + Image1(Image1.Count - 1).Height + 100 
End If 
If Mid(strst(i + 2), 4, 4) = "BMP|" Then 
Load Image1(Image1.UBound + 1) 
Image1(Image1.Count - 1).Picture = LoadPicture(App.Path & Mid(strst(i + 2), 8, Len(strst(i + 2)) - 7)) 
Check2(Check2.Count - 1).Caption = Mid(strst(i + 2), 1, 3) 
Check2(Check2.Count - 1).Width = 615 
Image1(Image1.Count - 1).Left = Check2(Check2.Count - 1).Left + Check2(Check2.Count - 1).Width + 100 
Image1(Image1.Count - 1).Top = Check2(Check2.Count - 1).Top + Check2(Check2.Count - 1).Height + 100 
Check2(Check2.Count - 1).Top = Image1(Image1.Count - 1).Top + (Image1(Image1.Count - 1).Height - Check2(Check2.Count - 1).Height) / 2 
Image1(Image1.Count - 1).Visible = True 
imgxj = True 
Else 
Check2(Check2.Count - 1).Caption = strst(i + 2) 
imgxj = False 
End If 
Check2(Check2.Count - 1).Visible = True 
'********************************************* 
Load Check3(Check3.UBound + 1) 
If imgxj = False Then 
Check3(Check3.Count - 1).Top = Check2(Check2.Count - 1).Top + Check2(Check2.Count - 1).Height + 100 
Else 
Check3(Check3.Count - 1).Top = Image1(Image1.Count - 1).Top + Image1(Image1.Count - 1).Height + 100 
End If 
If Mid(strst(i + 3), 4, 4) = "BMP|" Then 
Load Image1(Image1.UBound + 1) 
Image1(Image1.Count - 1).Picture = LoadPicture(App.Path & Mid(strst(i + 3), 8, Len(strst(i + 3)) - 7)) 
Check3(Check3.Count - 1).Caption = Mid(strst(i + 3), 1, 3) 
Check3(Check3.Count - 1).Width = 615 
Image1(Image1.Count - 1).Left = Check3(Check3.Count - 1).Left + Check3(Check3.Count - 1).Width + 100 
Image1(Image1.Count - 1).Top = Check3(Check3.Count - 1).Top + Check3(Check3.Count - 1).Height + 100 
Check3(Check3.Count - 1).Top = Image1(Image1.Count - 1).Top + (Image1(Image1.Count - 1).Height - Check3(Check3.Count - 1).Height) / 2 
Image1(Image1.Count - 1).Visible = True 
imgxj = True 
Else 
Check3(Check3.Count - 1).Caption = strst(i + 3) 
imgxj = False 
End If 
Check3(Check3.Count - 1).Visible = True 
'******************************************* 
Load Check4(Check4.UBound + 1) 
If imgxj = False Then 
Check4(Check4.Count - 1).Top = Check3(Check3.Count - 1).Top + Check3(Check3.Count - 1).Height + 100 
Else 
Check4(Check4.Count - 1).Top = Image1(Image1.Count - 1).Top + Image1(Image1.Count - 1).Height + 100 
End If 
 
If Mid(strst(i + 4), 4, 4) = "BMP|" Then 
Load Image1(Image1.UBound + 1) 
Image1(Image1.Count - 1).Picture = LoadPicture(App.Path & Mid(strst(i + 4), 8, Len(strst(i + 4)) - 7)) 
Check4(Check4.Count - 1).Caption = Mid(strst(i + 4), 1, 3) 
Check4(Check4.Count - 1).Width = 615 
Image1(Image1.Count - 1).Left = Check4(Check4.Count - 1).Left + Check4(Check4.Count - 1).Width + 100 
Image1(Image1.Count - 1).Top = Check4(Check4.Count - 1).Top + Check4(Check4.Count - 1).Height + 100 
Check4(Check4.Count - 1).Top = Image1(Image1.Count - 1).Top + (Image1(Image1.Count - 1).Height - Check4(Check4.Count - 1).Height) / 2 
Image1(Image1.Count - 1).Visible = True 
imgxj = True 
Else 
Check4(Check4.Count - 1).Caption = strst(i + 4) 
imgxj = False 
End If 
If strst(i + 4) <> "" Then 
Check4(Check4.Count - 1).Visible = True 
End If 
XPPBR1.Value = XPPBR1.Value + 1 
Next 
Close #1 
If imgxj = False Then 
PictureQG1.Height = Check4(Check4.Count - 1).Top + Check4(Check4.Count - 1).Height + 500 
Else 
PictureQG1.Height = Image1(Image1.Count - 1).Top + Image1(Image1.Count - 1).Height + 500 
End If 
'以下语句保证vscroll1在拉动中,同步的picture不会出界 
For j = 1 To 1000 
 If ((PictureQG1.Height - PictureBG1.ScaleHeight) Mod j) = 0 And (PictureQG1.Height - PictureBG1.ScaleHeight) / j < 32767 Then 
 vscmod = j 
 Exit For 
 End If 
Next 
VScroll1.Max = (PictureQG1.Height - PictureBG1.ScaleHeight) / vscmod 
Create_Boolean = True 
Labeltime.Caption = KS_TIME 
Timer2.Enabled = True 
End Sub 
 
Private Sub Label_showfont() 
' 设置“取消”为 True 
CommonDialog1.CancelError = True 
On Error GoTo ErrHandler 
' 设置 Flags 属性 
CommonDialog1.Flags = cdlCFEffects Or cdlCFBoth 
' 显示“字体”对话框 
CommonDialog1.ShowFont 
For i = 0 To Label1.Count - 1 
Label1(i).Font.name = CommonDialog1.FontName 
Label1(i).Font.Size = CommonDialog1.FontSize 
Label1(i).Font.Bold = CommonDialog1.FontBold 
Label1(i).Font.Italic = CommonDialog1.FontItalic 
Label1(i).Font.Underline = CommonDialog1.FontUnderline 
Label1(i).FontStrikethru = CommonDialog1.FontStrikethru 
Label1(i).ForeColor = CommonDialog1.Color 
Label1(i).Caption = Label1(i).Caption 
If Label1(i).Left + Label1(i).Width >= PictureQG1.ScaleWidth Then 
Label1(i).Width = Label1(i).Width * 2 
End If 
Next 
For i = 0 To Check1.Count - 1 
Check1(i).Font.name = CommonDialog1.FontName 
Check1(i).Font.Size = CommonDialog1.FontSize 
Check1(i).Font.Bold = CommonDialog1.FontBold 
Check1(i).Font.Italic = CommonDialog1.FontItalic 
Check1(i).Font.Underline = CommonDialog1.FontUnderline 
Check1(i).ForeColor = CommonDialog1.Color 
Check2(i).Font.name = CommonDialog1.FontName 
Check2(i).Font.Size = CommonDialog1.FontSize 
Check2(i).Font.Bold = CommonDialog1.FontBold 
Check2(i).Font.Italic = CommonDialog1.FontItalic 
Check2(i).Font.Underline = CommonDialog1.FontUnderline 
Check2(i).ForeColor = CommonDialog1.Color 
Check3(i).Font.name = CommonDialog1.FontName 
Check3(i).Font.Size = CommonDialog1.FontSize 
Check3(i).Font.Bold = CommonDialog1.FontBold 
Check3(i).Font.Italic = CommonDialog1.FontItalic 
Check3(i).Font.Underline = CommonDialog1.FontUnderline 
Check3(i).ForeColor = CommonDialog1.Color 
Check4(i).Font.name = CommonDialog1.FontName 
Check4(i).Font.Size = CommonDialog1.FontSize 
Check4(i).Font.Bold = CommonDialog1.FontBold 
Check4(i).Font.Italic = CommonDialog1.FontItalic 
Check4(i).Font.Underline = CommonDialog1.FontUnderline 
Check4(i).ForeColor = CommonDialog1.Color 
 
Next 
Exit Sub 
ErrHandler: 
' 用户按了“取消”按钮 
Exit Sub 
End Sub 
 
Private Sub Timer1_Timer() '设此时钟是用以保证文件传输中的空隙,否则将无法正确传送 
LabelCZ.Caption = "进入接收文件状态" 
sckClient.SendData "OPENPLAY|" & Filename & vbCrLf 
Timer1.Enabled = False 
End Sub 
 
Private Sub Timer2_Timer() 
Labeltime = Labeltime - 1 
If Int(Labeltime) <= 0 Then 
 Labeltime = "0" 
 Timer2.Enabled = False 
 LabelCZ.Caption = "考试已经结束,正在提交答案给服务器端" 
 SAVE_KEY '保存答案 
 Filename = App.Path & "\DATALIST\" & LoginName & "_answer.txt" 
 sckClient.SendData "FILENAME|" & Mid(Filename, InStrRev(Filename, "\") + 1) & vbCrLf 
 Filesize = FileLen(Filename) 
 sckClient.SendData "FILESIZE|" & Filesize & vbCrLf 
End If 
End Sub 
 
Private Sub VScroll1_Change() 
Dim vscnumber As Double '一定要引用出vscroll1.value的值,否则会出现溢出错误 
vscnumber = -VScroll1.Value 
PictureQG1.Top = vscnumber * vscmod 
End Sub 
 
Private Sub VScroll1_Scroll() 
Dim vscnumber As Double 
vscnumber = -VScroll1.Value 
PictureQG1.Top = vscnumber * vscmod 
End Sub 
 
 
Private Sub Form_Load() 
Client_load 
sckClient.RemoteHost = ConnentIP 'ServerIP '注释:可以更改为你运行服务器的主机名 
sckClient.RemotePort = 8888 
firsttime = True 
'XPPBR1.Visible = False '进度条不显示 
Picture1.BackColor = RGB(77, 77, 77) 
Picture2.BackColor = RGB(77, 77, 77) 
Picture3.BackColor = RGB(101, 101, 101) 
Picture4.BackColor = RGB(101, 101, 101) 
Set ACPRibbon1.Picture = ImageTOP.Picture 
 
'# Show Caption of Form 
ACPRibbon1.Caption = Me.Caption 
ACPRibbon1.AddTopButton "1", "手动保存答案", Imagemenu1.Picture 
'# Add Tabs ---   ID - Caption 
ACPRibbon1.AddTab "1", "试题生成" 
ACPRibbon1.AddTab "2", "试题设定" 
ACPRibbon1.AddTab "3", "提交答案" 
ACPRibbon1.AddTab "4", "系统设定" 
ACPRibbon1.AddTab "5", "退出系统" 
 
ACPRibbon1.AddCat "1", "1", "请求生成试题", False 
ACPRibbon1.AddCat "2", "1", "开始考试", False 
ACPRibbon1.AddCat "3", "2", "字体与大小设定", False 
ACPRibbon1.AddCat "4", "3", "提交答案", False 
ACPRibbon1.AddCat "5", "4", "机器ID", False 
ACPRibbon1.AddCat "6", "4", "服务器IP", False 
ACPRibbon1.AddCat "7", "5", "退出系统", False 
 
ACPRibbon1.AddButton "1", "1", "                                ", ImageTAB1.Picture, False, "发服务器端发送生成试题的请求" 
ACPRibbon1.AddButton "2", "2", "                           ", ImageTAB1.Picture, False, "开始读取试题" 
ACPRibbon1.AddButton "3", "3", "                                ", ImageTAB1.Picture, False, "设定字体与文字大小以适应您的要求" 
ACPRibbon1.AddButton "4", "4", "                                ", ImageTAB1.Picture, False, "将试题答案提交到服务器以获得本次考试的成绩" 
ACPRibbon1.AddButton "5", "5", "                                ", ImageTAB1.Picture, False, "设定本机ID编号,以让服务器端操作人员更好识别" 
ACPRibbon1.AddButton "6", "6", "                                ", ImageTAB1.Picture, False, "设定连接服务器端的IP地址" 
ACPRibbon1.AddButton "7", "7", "                                ", ImageTAB1.Picture, False, "退出本系统" 
 
ACPRibbon1.Refresh 
sckClient.Connect 
End Sub 
 
Private Sub Form_Resize() 
If Me.WindowState <> 1 Then 
Picture1.Move 0, Picture4.Top + Picture4.Height, Picture1.Width, Me.ScaleHeight - Picture1.Top 
Picture2.Move Me.ScaleWidth - Picture1.Width, Picture4.Top + Picture4.Height, Picture2.Width, Me.ScaleHeight - Picture1.Top 
Picture3.Move Picture1.Width, Me.ScaleHeight - Picture3.Height, Me.ScaleWidth - 50 
Picture4.Top = ACPRibbon1.Height 
Picture4.Left = 0 
Picture4.Width = Me.ScaleWidth 
Picture4.Height = 300 
Label_Time.Left = Picture4.ScaleWidth - Label_Time.Width - 500 
Labeltime.Left = Label_Time.Left + 1300 
VScroll1.Move Me.ScaleWidth - VScroll1.Width - Picture2.Width, Picture4.Top + Picture4.Height, VScroll1.Width, Me.ScaleHeight - Picture4.Top - Picture4.Height - Picture3.Height 
PictureBG1.Move Picture1.Width, Picture4.Top + Picture4.Height, Me.ScaleWidth - Picture1.Width - Picture2.Width - VScroll1.Width + 10, VScroll1.Height 
If Create_Boolean = True Then '当试题已读取时 
PictureQG1.Move 0, 0, PictureBG1.ScaleWidth, PictureQG1.Height 
Else 
PictureQG1.Move 0, 0, PictureBG1.ScaleWidth, PictureBG1.ScaleHeight 
End If 
ST_NAME.Left = (PictureQG1.ScaleWidth - ST_NAME.Width) / 2 
Picture_panel.Left = PictureQG1.ScaleWidth - Picture_panel.Width 
Vscroll_Max '重新计算vscroll1的最大值,再次区分比例 
'XPPBR1.Width = Label_Time.Left - Label_cz.Left - Label_cz.Width - 30 
Check1(0).Move Check1(0).Left, Check1(0).Top, PictureQG1.ScaleWidth - Check1(0).Left 
Check2(0).Move Check2(0).Left, Check2(0).Top, PictureQG1.ScaleWidth - Check2(0).Left 
Check3(0).Move Check3(0).Left, Check3(0).Top, PictureQG1.ScaleWidth - Check3(0).Left 
Check4(0).Move Check4(0).Left, Check4(0).Top, PictureQG1.ScaleWidth - Check4(0).Left 
XPPBR1.Left = Picture1.Width 
XPPBR1.Width = VScroll1.Left - Picture1.Width 
XPPBR1.Visible = False '以显示与不显示来实现控件的刷新 
XPPBR1.Visible = True 
End If 
End Sub 
Private Sub Vscroll_Max() 
For j = 1 To 1000 
 If ((PictureQG1.Height - PictureBG1.ScaleHeight) Mod j) = 0 And (PictureQG1.Height - PictureBG1.ScaleHeight) / j < 32767 Then 
 vscmod = j 
 Exit For 
 End If 
Next 
VScroll1.Max = (PictureQG1.Height - PictureBG1.ScaleHeight) / vscmod 
End Sub 
Private Sub sckClient_Close() 
MsgBox "服务器已关闭,请退出并重新连接。" 
End 
End Sub 
 
Private Sub sckClient_Connect() 
 
Dim name As String 
LabelID.Caption = LoginName 
LabelCZ.Caption = "已经成功连接服务器!" 
 
If firsttime = True Then 
name = LoginName 
sckClient.SendData "NAME|" & name & vbCrLf 
sckClient.SendData "COMPUTERID|" & Computer_id & vbCrLf 
firsttime = False 
 
End If 
End Sub 
 
Private Sub sckClient_DataArrival(ByVal bytesTotal As Long) 
On Error Resume Next 
    Dim strinput As String 
    Dim strParse() As String 
    Dim strText As String 
    Dim stritem As String 
    Dim strdata() As String 
    bytesTotal = 8192 
If down = True Then '当状态为接收文件时 
    Dim strbyte() As Byte 
    intFile = FreeFile 
    If (Filesize - Filecountsize) <= bytesTotal Then 
      bytesTotal = Filesize - Filecountsize 
      down = False 
      Filecountsize = 0 
    Else 
      Filecountsize = Filecountsize + bytesTotal 
    End If 
    sckClient.GetData strbyte, , bytesTotal 
    MkDir App.Path & "\" & LISTMID 
    Open App.Path & "\" & LISTMID & "\" & Filename For Binary As #intFile 
    Put #intFile, LOF(intFile) + 1, strbyte 
    Close #intFile 
    sckClient.GetData strbyte, , 8192 '此语句防止冗余数据扰乱程序运行,因此读出其残余记录 
If FileLen(App.Path & "\" & LISTMID & "\" & Filename) >= Filesize Then 
    down = False 
    sckClient.SendData "FULFILLINCEPT|" & LoginName & vbCrLf '发出已完成接收指令 
    If Filename = LoginName & "_key.txt" Then '当文件名为标准答案时 
     LabelCZ.Caption = "已接收标准答案,正在分析答案!" 
     AnswerBD '答案比对 
     Exit Sub 
    End If 
    If Dir(App.Path & ListEXECLLOG, vbNormal) <> "" And ListEXECLLOG <> "" Then 
    '读取发送的文件列表,获得里面的文件名,并向服务器发送请求 
    Dim ListEXL As String 
    Dim listEXLMENU() As String 
    Open App.Path & ListEXECLLOG For Binary As #1 
    Filesize = FileLen(App.Path & ListEXECLLOG) 
    ListEXL = Space(Filesize) 
    Get #1, , ListEXL 
    Close #1 
    listEXLMENU = Split(ListEXL, vbCrLf) 
    For i = 0 To UBound(listEXLMENU) - 1 
     If Dir(App.Path & listEXLMENU(i), vbNormal) = "" Then 
       sckClient.SendData "ASKLIST|" & listEXLMENU(i) & vbCrLf 
       LISTMID = Mid(listEXLMENU(i), 2, InStrRev(listEXLMENU(i), "\") - 2) 
       Exit For 
     End If 
    Next 
    End If 
    LabelCZ.Caption = "已经完成试题的接收,可以生成(点击开始考试按钮)试卷了!" 
    '进入打开列表,利用回车区分,按顺序获取文件名,并发送给服务器端,这样重复传输各种文件 
    Exit Sub 
End If 
Else 
sckClient.GetData strinput, , bytesTotal 
strdata = Split(strinput, vbCrLf) 
For i = 0 To UBound(strdata) 
strText = "" 
strText = strdata(i) 
If strText <> "" Then 
        strParse = Split(strText, "|") 
        '由于出现接收到下标越界的错误,因此使用判断分隔strparse出的行是否=0 
        '等于0时退出操作 
        If UBound(strParse) = 0 Then 
        Exit Sub 
        End If 
        strText = strParse(0) 
        stritem = strParse(1) 
Select Case UCase(strText) 
Case "FILESIZE" '获取文件大小 
    Filesize = stritem 
    down = True '接收名称后自动进入接收文件状态 
    If ListEXECLLOG = "" Then 
     ListEXECLLOG = "\DATALIST\" & Filename 
     LISTMID = "DATALIST" 
    End If 
    Timer1.Enabled = True '发送进入传送状态指令,用时钟来保证各传输数据间的间隙 
    Exit Sub 
Case "FILENAME" '获取文件名称 
    Filename = stritem 
    If Dir(App.Path & "\DATALIST\" & Filename, vbNormal) <> "" Then 
    Kill App.Path & "\DATALIST\" & Filename 
    End If 
    LabelCZ.Caption = "获取需接收文件的文件名!" 
Case "KSTIME" '考试时间 
    KS_TIME = stritem * 60 
    TIMECOUNT.Caption = "考试时间:" & stritem & "分钟" 
Case "OPENPLAY" '接收到客户端的文件接收请求 
    send_file 
Case "KSNAME" '考试的名称 
    ST_NAME.Caption = stritem 
    ST_NAME.Left = (PictureQG1.ScaleWidth - ST_NAME.Width) / 2 
Case "COUNTFENG" '试卷总分 
    count_mark.Caption = "总分:" & stritem & "分" 
Case "RIGHTMENT" 
    score_label.Caption = "得分:" & stritem & "分" 
Case "COUNTSTNUMBER" 
    Count_stnumber.Caption = "总题数:" & stritem & "题" 
Case "RSTNUMBER" 
    R_stnumber.Caption = "正确题数:" & stritem & "题" 
Case "WSTNUMBER" 
    W_stnumber.Caption = "错误题数:" & stritem & "题" 
End Select 
End If 
Next 
End If 
End Sub 
Private Sub send_file() 
On Error GoTo 1 
          Dim myFile()  As Byte 
          Dim dblSent As Double 
          Dim filemax As Double 
          filemax = 8192 
Open Filename For Binary As #1 
    If Filesize <= filemax Then '8192为极限缓存 
        myFile = Space(Filesize) 
        Get #1, , myFile 
        sckClient.SendData myFile 
        GoTo 1 
    End If 
    '超过 1KB - 将分段为 8192 字节 
     
    Do While EOF(1) = False 
        If dblSent + filemax <= Filesize Then 
            myFile = Space(filemax) 
            Get #1, , myFile 
            sckClient.SendData myFile 
            dblSent = dblSent + filemax 
            DoEvents 
        Else 
            myFile = Space(filemax - dblSent) 
            Get #1, , myFile 
            sckClient.SendData myFile 
            Exit Do 
        End If 
        DoEvents 
    Loop 
    Close #1 
   LabelCZ.Caption = "答案已成功的发送到服务器端!等待计算得分中...." 
1: 
Close #1 
End Sub 
Private Sub sckClient_Error(ByVal Number As Integer, Description As String, ByVal Scode As Long, ByVal Source As String, ByVal HelpFile As String, ByVal HelpContext As Long, CancelDisplay As Boolean) 
sckClient.Close 
End Sub 
'*********************************************** 
'以下为单选项的处理 
Private Sub Check1_Click(Index As Integer) 
Check2(Index).Value = 0 
Check3(Index).Value = 0 
Check4(Index).Value = 0 
End Sub 
 
Private Sub Check2_Click(Index As Integer) 
Check1(Index).Value = 0 
Check3(Index).Value = 0 
Check4(Index).Value = 0 
End Sub 
 
Private Sub Check3_Click(Index As Integer) 
Check1(Index).Value = 0 
Check2(Index).Value = 0 
Check4(Index).Value = 0 
End Sub 
 
Private Sub Check4_Click(Index As Integer) 
Check1(Index).Value = 0 
Check2(Index).Value = 0 
Check3(Index).Value = 0 
End Sub 
'**************************************** 
Private Sub Client_load() '客户端设置读取机器ID快捷识别编号 
Dim buff As String 
Dim backFile As String 
Dim ret As Integer 
buff = String(255, 0) 
ret = GetPrivateProfileString("Client", "ClientID", "", buff, 256, App.Path & "\client.ini") 
If ret = 0 Then '当client文件不存在或无clientID目录时 
Computer_id = "A01" 
ret = WritePrivateProfileString("Client", "ClientID", Computer_id, App.Path & "\client.ini") 
Else 
Computer_id = buff 
End If 
ret = GetPrivateProfileString("Client", "ServerIP", "", buff, 256, App.Path & "\client.ini") 
ServerIP = buff 
End Sub 
'*********************************** 
Private Sub AnswerBD() '答案比对 
On Error GoTo finish: 
 Dim keycontrast As String 
Dim keycontrast1() As String 
Dim keycontrast2() As String 
Dim Rightnumber As Integer 
Filesize = FileLen(App.Path & "\DATALIST\" & LoginName & "_key.txt") 
Open App.Path & "\DATALIST\" & LoginName & "_key.txt" For Binary As #1 
keycontrast = Space(Filesize) 
Get #1, , keycontrast 
keycontrast1 = Split(keycontrast, vbCrLf) 
Close #1 
Filesize = FileLen(App.Path & "\DATALIST\" & LoginName & "_answer.txt") 
Open App.Path & "\DATALIST\" & LoginName & "_answer.txt" For Binary As #1 
keycontrast = Space(Filesize) 
Get #1, , keycontrast 
keycontrast2 = Split(keycontrast, vbCrLf) 
Close #1 
For i = 0 To UBound(keycontrast1) - 1 
  Load Answer_R(Answer_R.UBound + 1) 
  Answer_R(Answer_R.Count - 1).Left = Label1(i + 1).Left + Label1(i + 1).Width + 30 
  Answer_R(Answer_R.Count - 1).Top = Label1(i + 1).Top + (Label1(i + 1).Height / 2) - (Answer_R(Answer_R.Count - 1).Height / 2) 
  Answer_R(Answer_R.Count - 1).Caption = "正确答案:" & keycontrast1(i) 
  If (Answer_R(Answer_R.Count - 1).Left + Answer_R(Answer_R.Count - 1).Width) > PictureQG1.ScaleWidth Then 
   'Answer_R(Answer_R.Count - 1).Top = Answer_R(Answer_R.Count - 1).Top + Answer_R(Answer_R.Count - 1).Height + 30 
   Answer_R(Answer_R.Count - 1).Left = PictureQG1.ScaleWidth - Answer_R(Answer_R.Count - 1).Width 
   Label1(i + 1).Width = Answer_R(Answer_R.Count - 1).Left - Label1(i + 1).Left - 20 
  End If 
  Answer_R(Answer_R.Count - 1).Visible = True 
 If keycontrast1(i) <> keycontrast2(i) Then 
  Load Img_w(Img_w.UBound + 1) 
  Img_w(Img_w.Count - 1).Left = Label1(0).Left - (Img_w(Img_w.Count - 1).Width / 2) 
  Img_w(Img_w.Count - 1).Top = Label1(i + 1).Top + (Label1(i + 1).Height / 2) - (Img_w(Img_w.Count - 1).Height / 2) 
  Img_w(Img_w.Count - 1).Visible = True 
 End If 
Next 
LabelCZ.Caption = "此次考试已完成,计时中止!" 
Exit Sub 
finish: 
MsgBox "发现未知错误!错误内容:" & Err.Description, vbInformation, "提示" 
End Sub