www.pudn.com > textmanager.rar > FrmMain.frm, change:2005-04-12,size:21433b


VERSION 5.00 
Begin VB.Form FrmMain  
   BorderStyle     =   0  'None 
   Caption         =   "Form1" 
   ClientHeight    =   8715 
   ClientLeft      =   60 
   ClientTop       =   345 
   ClientWidth     =   12000 
   LinkTopic       =   "Form1" 
   LockControls    =   -1  'True 
   Picture         =   "FrmMain.frx":0000 
   ScaleHeight     =   581 
   ScaleMode       =   3  'Pixel 
   ScaleWidth      =   800 
   ShowInTaskbar   =   0   'False 
   StartUpPosition =   3  '窗口缺省 
   WindowState     =   2  'Maximized 
   Begin VB.TextBox TxTNewPass1  
      Appearance      =   0  'Flat 
      BeginProperty Font  
         Name            =   "宋体" 
         Size            =   12 
         Charset         =   134 
         Weight          =   700 
         Underline       =   0   'False 
         Italic          =   0   'False 
         Strikethrough   =   0   'False 
      EndProperty 
      Height          =   375 
      IMEMode         =   3  'DISABLE 
      Left            =   4170 
      PasswordChar    =   "*" 
      TabIndex        =   14 
      Top             =   4485 
      Visible         =   0   'False 
      Width           =   2145 
   End 
   Begin VB.TextBox TxTNewPass  
      Appearance      =   0  'Flat 
      BeginProperty Font  
         Name            =   "宋体" 
         Size            =   12 
         Charset         =   134 
         Weight          =   700 
         Underline       =   0   'False 
         Italic          =   0   'False 
         Strikethrough   =   0   'False 
      EndProperty 
      Height          =   375 
      IMEMode         =   3  'DISABLE 
      Left            =   4170 
      PasswordChar    =   "*" 
      TabIndex        =   12 
      Top             =   3615 
      Visible         =   0   'False 
      Width           =   2145 
   End 
   Begin VB.TextBox TXTOldPass  
      Appearance      =   0  'Flat 
      BeginProperty Font  
         Name            =   "宋体" 
         Size            =   12 
         Charset         =   134 
         Weight          =   700 
         Underline       =   0   'False 
         Italic          =   0   'False 
         Strikethrough   =   0   'False 
      EndProperty 
      Height          =   375 
      IMEMode         =   3  'DISABLE 
      Left            =   4155 
      PasswordChar    =   "*" 
      TabIndex        =   10 
      Top             =   2610 
      Visible         =   0   'False 
      Width           =   2145 
   End 
   Begin VB.Label LabOK  
      Alignment       =   2  'Center 
      Appearance      =   0  'Flat 
      BackColor       =   &H0080C0FF& 
      BorderStyle     =   1  'Fixed Single 
      Caption         =   "确定" 
      BeginProperty Font  
         Name            =   "宋体" 
         Size            =   14.25 
         Charset         =   134 
         Weight          =   700 
         Underline       =   0   'False 
         Italic          =   0   'False 
         Strikethrough   =   0   'False 
      EndProperty 
      ForeColor       =   &H80000008& 
      Height          =   345 
      Left            =   3015 
      MouseIcon       =   "FrmMain.frx":11AA8 
      MousePointer    =   99  'Custom 
      TabIndex        =   16 
      Top             =   5655 
      Visible         =   0   'False 
      Width           =   975 
   End 
   Begin VB.Label LabEsc  
      Alignment       =   2  'Center 
      Appearance      =   0  'Flat 
      BackColor       =   &H0080C0FF& 
      BorderStyle     =   1  'Fixed Single 
      Caption         =   "取消" 
      BeginProperty Font  
         Name            =   "宋体" 
         Size            =   14.25 
         Charset         =   134 
         Weight          =   700 
         Underline       =   0   'False 
         Italic          =   0   'False 
         Strikethrough   =   0   'False 
      EndProperty 
      ForeColor       =   &H80000008& 
      Height          =   345 
      Left            =   4875 
      MouseIcon       =   "FrmMain.frx":11EEA 
      MousePointer    =   99  'Custom 
      TabIndex        =   15 
      Top             =   5655 
      Visible         =   0   'False 
      Width           =   975 
   End 
   Begin VB.Label LabNew1  
      AutoSize        =   -1  'True 
      BackStyle       =   0  'Transparent 
      Caption         =   "确新密码:" 
      BeginProperty Font  
         Name            =   "楷体_GB2312" 
         Size            =   18 
         Charset         =   134 
         Weight          =   700 
         Underline       =   0   'False 
         Italic          =   0   'False 
         Strikethrough   =   0   'False 
      EndProperty 
      ForeColor       =   &H0000FFFF& 
      Height          =   360 
      Left            =   2505 
      TabIndex        =   13 
      Top             =   4485 
      Visible         =   0   'False 
      Width           =   1890 
   End 
   Begin VB.Label LabNew  
      AutoSize        =   -1  'True 
      BackStyle       =   0  'Transparent 
      Caption         =   "新密码:" 
      BeginProperty Font  
         Name            =   "楷体_GB2312" 
         Size            =   18 
         Charset         =   134 
         Weight          =   700 
         Underline       =   0   'False 
         Italic          =   0   'False 
         Strikethrough   =   0   'False 
      EndProperty 
      ForeColor       =   &H0000FFFF& 
      Height          =   360 
      Left            =   2880 
      TabIndex        =   11 
      Top             =   3630 
      Visible         =   0   'False 
      Width           =   1515 
   End 
   Begin VB.Label LabOld  
      AutoSize        =   -1  'True 
      BackStyle       =   0  'Transparent 
      Caption         =   "原密码:" 
      BeginProperty Font  
         Name            =   "楷体_GB2312" 
         Size            =   18 
         Charset         =   134 
         Weight          =   700 
         Underline       =   0   'False 
         Italic          =   0   'False 
         Strikethrough   =   0   'False 
      EndProperty 
      ForeColor       =   &H0000FFFF& 
      Height          =   360 
      Left            =   2850 
      TabIndex        =   9 
      Top             =   2595 
      Visible         =   0   'False 
      Width           =   1320 
   End 
   Begin VB.Shape Shape1  
      BorderColor     =   &H00C0E0FF& 
      BorderWidth     =   2 
      Height          =   5535 
      Left            =   2355 
      Top             =   1575 
      Width           =   4530 
   End 
   Begin VB.Label Label1  
      AutoSize        =   -1  'True 
      BackStyle       =   0  'Transparent 
      Caption         =   "姓名:" 
      BeginProperty Font  
         Name            =   "楷体_GB2312" 
         Size            =   18 
         Charset         =   134 
         Weight          =   700 
         Underline       =   0   'False 
         Italic          =   0   'False 
         Strikethrough   =   0   'False 
      EndProperty 
      ForeColor       =   &H00C00000& 
      Height          =   390 
      Left            =   3270 
      TabIndex        =   8 
      Top             =   1710 
      Width           =   1140 
   End 
   Begin VB.Label LabName  
      AutoSize        =   -1  'True 
      BackStyle       =   0  'Transparent 
      Caption         =   "姓名:" 
      BeginProperty Font  
         Name            =   "楷体_GB2312" 
         Size            =   18 
         Charset         =   134 
         Weight          =   700 
         Underline       =   0   'False 
         Italic          =   0   'False 
         Strikethrough   =   0   'False 
      EndProperty 
      ForeColor       =   &H000000C0& 
      Height          =   390 
      Left            =   4245 
      TabIndex        =   7 
      Top             =   1725 
      Width           =   1140 
   End 
   Begin VB.Label Label3  
      AutoSize        =   -1  'True 
      BackStyle       =   0  'Transparent 
      Caption         =   "姓别:" 
      BeginProperty Font  
         Name            =   "楷体_GB2312" 
         Size            =   18 
         Charset         =   134 
         Weight          =   700 
         Underline       =   0   'False 
         Italic          =   0   'False 
         Strikethrough   =   0   'False 
      EndProperty 
      ForeColor       =   &H00C00000& 
      Height          =   360 
      Left            =   3270 
      TabIndex        =   6 
      Top             =   3390 
      Width           =   1140 
   End 
   Begin VB.Label LabSex  
      AutoSize        =   -1  'True 
      BackStyle       =   0  'Transparent 
      Caption         =   "姓名:" 
      BeginProperty Font  
         Name            =   "楷体_GB2312" 
         Size            =   18 
         Charset         =   134 
         Weight          =   700 
         Underline       =   0   'False 
         Italic          =   0   'False 
         Strikethrough   =   0   'False 
      EndProperty 
      ForeColor       =   &H000000C0& 
      Height          =   390 
      Left            =   4260 
      TabIndex        =   5 
      Top             =   3405 
      Width           =   1140 
   End 
   Begin VB.Label Label5  
      AutoSize        =   -1  'True 
      BackStyle       =   0  'Transparent 
      Caption         =   "入学年份:" 
      BeginProperty Font  
         Name            =   "楷体_GB2312" 
         Size            =   18 
         Charset         =   134 
         Weight          =   700 
         Underline       =   0   'False 
         Italic          =   0   'False 
         Strikethrough   =   0   'False 
      EndProperty 
      ForeColor       =   &H00C00000& 
      Height          =   360 
      Left            =   3255 
      TabIndex        =   4 
      Top             =   4920 
      Width           =   1890 
   End 
   Begin VB.Label LabYear  
      AutoSize        =   -1  'True 
      BackStyle       =   0  'Transparent 
      Caption         =   "1998年" 
      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            =   4995 
      TabIndex        =   3 
      Top             =   4935 
      Width           =   1170 
   End 
   Begin VB.Label Label7  
      AutoSize        =   -1  'True 
      BackStyle       =   0  'Transparent 
      Caption         =   "学号:" 
      BeginProperty Font  
         Name            =   "楷体_GB2312" 
         Size            =   18 
         Charset         =   134 
         Weight          =   700 
         Underline       =   0   'False 
         Italic          =   0   'False 
         Strikethrough   =   0   'False 
      EndProperty 
      ForeColor       =   &H00C00000& 
      Height          =   360 
      Left            =   3225 
      TabIndex        =   2 
      Top             =   6285 
      Width           =   1140 
   End 
   Begin VB.Label LabCode  
      AutoSize        =   -1  'True 
      BackStyle       =   0  'Transparent 
      Caption         =   "19980123" 
      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           =   1575 
   End 
   Begin VB.Image Imgks1  
      Height          =   495 
      Left            =   6540 
      Picture         =   "FrmMain.frx":1232C 
      Stretch         =   -1  'True 
      Top             =   810 
      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            =   7275 
      Picture         =   "FrmMain.frx":20EC1 
      Stretch         =   -1  'True 
      Top             =   1020 
      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            =   225 
      TabIndex        =   17 
      Top             =   435 
      Width           =   8385 
   End 
   Begin VB.Label LabXinXi  
      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       =   &H000000C0& 
      Height          =   660 
      Left            =   270 
      TabIndex        =   18 
      Top             =   450 
      Width           =   8385 
   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 
  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 Sub 
 
Private Sub imgExit_Click() 
 Unload Me 
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