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


VERSION 5.00 
Begin VB.Form frmLogin  
   BorderStyle     =   0  'None 
   Caption         =   "登录" 
   ClientHeight    =   2385 
   ClientLeft      =   2790 
   ClientTop       =   3150 
   ClientWidth     =   4380 
   LinkTopic       =   "Form1" 
   LockControls    =   -1  'True 
   MaxButton       =   0   'False 
   MinButton       =   0   'False 
   ScaleHeight     =   1409.137 
   ScaleMode       =   0  'User 
   ScaleWidth      =   4112.583 
   ShowInTaskbar   =   0   'False 
   StartUpPosition =   2  '屏幕中心 
   Begin VB.TextBox txtUserCode  
      Appearance      =   0  'Flat 
      BackColor       =   &H00E8F4F8& 
      BeginProperty Font  
         Name            =   "宋体" 
         Size            =   14.25 
         Charset         =   134 
         Weight          =   700 
         Underline       =   0   'False 
         Italic          =   0   'False 
         Strikethrough   =   0   'False 
      EndProperty 
      ForeColor       =   &H000040C0& 
      Height          =   375 
      Left            =   1395 
      TabIndex        =   1 
      Top             =   510 
      Width           =   2115 
   End 
   Begin VB.TextBox txtPassword  
      Appearance      =   0  'Flat 
      BackColor       =   &H00E8F4F8& 
      BeginProperty Font  
         Name            =   "宋体" 
         Size            =   14.25 
         Charset         =   134 
         Weight          =   700 
         Underline       =   0   'False 
         Italic          =   0   'False 
         Strikethrough   =   0   'False 
      EndProperty 
      ForeColor       =   &H000040C0& 
      Height          =   375 
      IMEMode         =   3  'DISABLE 
      Left            =   1410 
      PasswordChar    =   "*" 
      TabIndex        =   2 
      Top             =   1050 
      Width           =   2115 
   End 
   Begin VB.Label cmdOK  
      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            =   990 
      MouseIcon       =   "frmLogin.frx":0000 
      MousePointer    =   99  'Custom 
      TabIndex        =   6 
      Top             =   1755 
      Width           =   975 
   End 
   Begin VB.Label CmdCanCel  
      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            =   2655 
      MouseIcon       =   "frmLogin.frx":0442 
      MousePointer    =   99  'Custom 
      TabIndex        =   5 
      Top             =   1755 
      Width           =   975 
   End 
   Begin VB.Label lblLabels  
      Appearance      =   0  'Flat 
      AutoSize        =   -1  'True 
      BackColor       =   &H80000005& 
      BackStyle       =   0  'Transparent 
      Caption         =   "密码:" 
      BeginProperty Font  
         Name            =   "楷体_GB2312" 
         Size            =   14.25 
         Charset         =   134 
         Weight          =   700 
         Underline       =   0   'False 
         Italic          =   0   'False 
         Strikethrough   =   0   'False 
      EndProperty 
      ForeColor       =   &H0000FFFF& 
      Height          =   285 
      Index           =   1 
      Left            =   570 
      TabIndex        =   4 
      Top             =   1065 
      Width           =   960 
   End 
   Begin VB.Label LabTitle  
      Alignment       =   2  'Center 
      BackStyle       =   0  'Transparent 
      Caption         =   "考试系统登录" 
      BeginProperty Font  
         Name            =   "楷体_GB2312" 
         Size            =   12 
         Charset         =   134 
         Weight          =   700 
         Underline       =   0   'False 
         Italic          =   0   'False 
         Strikethrough   =   0   'False 
      EndProperty 
      ForeColor       =   &H000000C0& 
      Height          =   270 
      Left            =   30 
      TabIndex        =   3 
      Top             =   45 
      Width           =   4320 
   End 
   Begin VB.Shape Shape2  
      BackColor       =   &H00FFC0C0& 
      BackStyle       =   1  'Opaque 
      BorderColor     =   &H00FF8080& 
      BorderWidth     =   2 
      Height          =   315 
      Left            =   15 
      Top             =   15 
      Width           =   4365 
   End 
   Begin VB.Label lblLabels  
      Appearance      =   0  'Flat 
      AutoSize        =   -1  'True 
      BackColor       =   &H80000005& 
      BackStyle       =   0  'Transparent 
      Caption         =   "学号:" 
      BeginProperty Font  
         Name            =   "楷体_GB2312" 
         Size            =   14.25 
         Charset         =   134 
         Weight          =   700 
         Underline       =   0   'False 
         Italic          =   0   'False 
         Strikethrough   =   0   'False 
      EndProperty 
      ForeColor       =   &H0000FFFF& 
      Height          =   285 
      Index           =   0 
      Left            =   585 
      TabIndex        =   0 
      Top             =   555 
      Width           =   885 
   End 
   Begin VB.Shape Shape1  
      BackColor       =   &H00FFC0C0& 
      BackStyle       =   1  'Opaque 
      BorderColor     =   &H00FF8080& 
      BorderWidth     =   2 
      Height          =   2355 
      Left            =   15 
      Top             =   30 
      Width           =   4365 
   End 
End 
Attribute VB_Name = "frmLogin" 
Attribute VB_GlobalNameSpace = False 
Attribute VB_Creatable = False 
Attribute VB_PredeclaredId = True 
Attribute VB_Exposed = False 
Option Explicit 
 
Private Sub cmdCancel_Click() 
    Unload Me 
End Sub 
 
Private Sub cmdOK_Click() 
   If txtUserCode.Text = "" Then 
     MsgBox "请输入你的考号!" 
     Exit Sub 
   End If 
   Dim adoRS As Recordset 
   Set adoRS = New Recordset 
   adoRS.CursorLocation = adUseClient 
 
   adoRS.Open "select pass,id from kaosheng where code='" + txtUserCode.Text + "'", ConnString, adOpenStatic, adLockOptimistic 
   'adoRS.Open "kaosheng", ConnString, adOpenStatic, adLockOptimistic 
   If adoRS.EOF Then 
     MsgBox "学生库里没有这个学号学生,请检查你的输入是否有错!" 
     txtUserCode.SetFocus 
     SendKeys "{Home}+{End}" 
     Exit Sub 
    Else 
     If txtPassword <> adoRS.Fields("pass") Then 
       MsgBox "无效的密码,请重试!", , "登录" 
       txtPassword.SetFocus 
       SendKeys "{Home}+{End}" 
       Exit Sub 
      Else 
       '登录 
       StudentID = Trim(Str(adoRS.Fields("id").Value)) 
       FrmMain.Show 
       FrmClient.M_Login.Enabled = False 
     End If 
   End If 
    
  Unload Me 
End Sub 
 
 
Private Sub Form_Load() 
   ConnString = "PROVIDER=Microsoft.Jet.OLEDB.3.51;Data Source=" + GetPrvPath(App.Path) + "\question.mdb;Jet OLEDB:" 
End Sub 
 
Private Sub LabTitle_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single) 
         ReleaseCapture 
 Dim ret As Long 
  ret = SendMessage(Me.hwnd, WM_SYSCOMMAND, SC_MOVE + HTCAPTION, 0) 
 
End Sub 
 
Private Sub txtPassword_KeyPress(KeyAscii As Integer) 
   If KeyAscii = 39 Then KeyAscii = -24145 
 
End Sub 
 
Private Sub txtUserCode_KeyPress(KeyAscii As Integer) 
    If KeyAscii = 39 Then KeyAscii = -24145 
 
End Sub