www.pudn.com > xj1.rar > Form1.frm, change:2008-06-02,size:8539b


VERSION 5.00 
Begin VB.Form Form1  
   Caption         =   "实验考试系统" 
   ClientHeight    =   3240 
   ClientLeft      =   4005 
   ClientTop       =   4455 
   ClientWidth     =   4680 
   LinkTopic       =   "Form1" 
   ScaleHeight     =   3240 
   ScaleWidth      =   4680 
   StartUpPosition =   2  '屏幕中心 
   Begin VB.Timer Timer2  
      Interval        =   100 
      Left            =   120 
      Top             =   2760 
   End 
   Begin VB.TextBox Text2  
      Height          =   375 
      IMEMode         =   3  'DISABLE 
      Left            =   1680 
      PasswordChar    =   "*" 
      TabIndex        =   2 
      Top             =   1320 
      Width           =   1815 
   End 
   Begin VB.Timer Timer1  
      Interval        =   1000 
      Left            =   4080 
      Top             =   240 
   End 
   Begin VB.CommandButton Command2  
      Caption         =   "取消" 
      Height          =   495 
      Left            =   2640 
      TabIndex        =   4 
      Top             =   1920 
      Width           =   1095 
   End 
   Begin VB.CommandButton Command1  
      Caption         =   "登录" 
      Height          =   495 
      Left            =   960 
      TabIndex        =   3 
      Top             =   1920 
      Width           =   1095 
   End 
   Begin VB.TextBox Text1  
      BeginProperty DataFormat  
         Type            =   0 
         Format          =   "0" 
         HaveTrueFalseNull=   0 
         FirstDayOfWeek  =   0 
         FirstWeekOfYear =   0 
         LCID            =   2052 
         SubFormatType   =   0 
      EndProperty 
      Height          =   375 
      Left            =   1680 
      TabIndex        =   1 
      Top             =   720 
      Width           =   1815 
   End 
   Begin VB.Label Label3  
      AutoSize        =   -1  'True 
      Caption         =   "温馨提示:本考试系统中初始的考生学号和密码相同,学号分别从1001至1010,共十人信息!!" 
      BeginProperty Font  
         Name            =   "宋体" 
         Size            =   12 
         Charset         =   134 
         Weight          =   700 
         Underline       =   0   'False 
         Italic          =   0   'False 
         Strikethrough   =   0   'False 
      EndProperty 
      ForeColor       =   &H000000FF& 
      Height          =   240 
      Left            =   3840 
      TabIndex        =   7 
      Top             =   2880 
      Width           =   10170 
   End 
   Begin VB.Label Label2  
      Caption         =   "密  码" 
      BeginProperty Font  
         Name            =   "宋体" 
         Size            =   12 
         Charset         =   134 
         Weight          =   400 
         Underline       =   0   'False 
         Italic          =   0   'False 
         Strikethrough   =   0   'False 
      EndProperty 
      Height          =   375 
      Left            =   840 
      TabIndex        =   6 
      Top             =   1320 
      Width           =   735 
   End 
   Begin VB.Label Label4  
      AutoSize        =   -1  'True 
      BackColor       =   &H8000000B& 
      BeginProperty Font  
         Name            =   "宋体" 
         Size            =   12 
         Charset         =   134 
         Weight          =   700 
         Underline       =   0   'False 
         Italic          =   0   'False 
         Strikethrough   =   0   'False 
      EndProperty 
      ForeColor       =   &H000000FF& 
      Height          =   240 
      Left            =   960 
      TabIndex        =   5 
      Top             =   2520 
      Visible         =   0   'False 
      Width           =   135 
   End 
   Begin VB.Label Label1  
      AutoSize        =   -1  'True 
      Caption         =   "学  号" 
      BeginProperty Font  
         Name            =   "宋体" 
         Size            =   12 
         Charset         =   134 
         Weight          =   400 
         Underline       =   0   'False 
         Italic          =   0   'False 
         Strikethrough   =   0   'False 
      EndProperty 
      Height          =   240 
      Left            =   840 
      TabIndex        =   0 
      Top             =   720 
      Width           =   720 
   End 
   Begin VB.Menu file  
      Caption         =   "文件(&F)" 
      WindowList      =   -1  'True 
      Begin VB.Menu denglu  
         Caption         =   "登录" 
      End 
      Begin VB.Menu creat  
         Caption         =   "创建试题库(&C)" 
      End 
      Begin VB.Menu a  
         Caption         =   "-" 
      End 
      Begin VB.Menu exit  
         Caption         =   "退出" 
      End 
   End 
   Begin VB.Menu xieshi  
      Caption         =   "显示(&A)" 
      Begin VB.Menu time  
         Caption         =   "系统时间" 
         Shortcut        =   ^T 
      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 shouming  
      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 = "Form1" 
Attribute VB_GlobalNameSpace = False 
Attribute VB_Creatable = False 
Attribute VB_PredeclaredId = True 
Attribute VB_Exposed = False 
Dim kaosheng  As people 
 
 
 
Private Sub all_Click() 
Call duma 
End Sub 
 
Private Sub Command1_Click() 
password = Text2.text 
On Error GoTo err 
Open "data\ksxx.dat" For Random As #1 Len = Len(kaosheng) 
For i = 1 To LOF(1) \ Len(kaosheng) + 1 
Get #1, i, kaosheng 
If RTrim(kaosheng.xuehao) = Text1.text Then         '检查学号是否存在 
Exit For 
End If 
Next i 
If i = LOF(1) \ Len(kaosheng) + 2 Then 
MsgBox "学号不存在", vbInformation, "实验考试系统" 
Close #1 
Exit Sub 
ElseIf RTrim(kaosheng.password) <> password Then 
MsgBox "密码错误", vbInformation, "实验考试系统" 
Text2.text = ""               '若密码错误,则清空密码框,并设置焦点 
Text2.SetFocus 
Close #1 
Exit Sub 
Else 
msg = "欢迎登录考试系统参加考试" 
MsgBox msg, vbInformation, "实验考试系统" 
Load Form2  '加载窗体2,并读入个人信息 
Form2.show 
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 
Close #1 
Unload Me 
End If 
err: 
If err.Number = 53 Then MsgBox "考生信息文件不存在,可能被移动或删除", vbInformation, "实验考试系统" 
End Sub 
 
Private Sub Command2_Click() 
End 
End Sub 
 
Private Sub creat_Click() 
Load Form6 
Form6.show 
Unload Me 
End Sub 
 
 
Private Sub cxcj_Click() 
Call xinxi_Click 
End Sub 
 
Private Sub exit_Click() 
Unload Me 
End Sub 
 
 
 
Private Sub Form_Load() 
Dim password As String 
Dim s As Integer 
s = 0 
End Sub 
 
Private Sub help_Click() 
MsgBox "无可用帮助,请见使用说明!", vbInformation, "实验考试系统" 
End Sub 
 
 
Private Sub html_Click() 
'打开网页说明 
Call shoum1 
End Sub 
 
Private Sub local_Click() 
'查看代码 
Form7.show 
Form7.Label2.Caption = "data\form2.dat" 
Call dudaima 
End Sub 
 
'定义键盘事件,方便登录 
Private Sub Text1_KeyPress(KeyAscii As Integer) 
If KeyAscii = 13 And Text2.text = "" Then 
MsgBox "请输入密码", vbOKOnly, "实验考试系统" 
ElseIf KeyAscii = 13 And Text2.text <> "" Then 
Call Command1_Click 
End If 
End Sub 
 
'回车可登陆 
Private Sub Text2_KeyPress(KeyAscii As Integer) 
If KeyAscii = 13 Then Call Command1_Click 
End Sub 
 
Private Sub time_Click() 
'显示系统当前时间 
Label4.Visible = True 
Timer1.Enabled = True 
Label4.Caption = Now() 
End Sub 
 
Private Sub Timer1_Timer() 
'同上 
Label4.Caption = Now() 
r = Int(Rnd * 255) + 0 
g = Int(Rnd * 255) + 0 
B = Int(Rnd * 255) + 0 
Label3.ForeColor = RGB(r, g, B) 
End Sub 
 
Private Sub Timer2_Timer() 
'移动字幕提示信息 
Label3.Left = Label3.Left - 100 
If Label3.Left < -6640 Then Label3.Left = 3840 
 
End Sub 
 
Private Sub txt_Click() 
'打开文本说明 
Call shuom 
End Sub 
'不登录无法查询 
Private Sub xinxi_Click() 
MsgBox "请先登录!", vbInformation, "实验考试系统" 
End Sub