⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 frmpwd.frm

📁 VB开发的考试系统,找了好久,希望有帮助,大家看看啊
💻 FRM
字号:
VERSION 5.00
Begin VB.Form frmPwd 
   BackColor       =   &H00FF0000&
   Caption         =   "请输入验证密码"
   ClientHeight    =   1155
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   2910
   ControlBox      =   0   'False
   LinkTopic       =   "Form1"
   ScaleHeight     =   1155
   ScaleWidth      =   2910
   StartUpPosition =   2  'CenterScreen
   Begin VB.CommandButton cmdEnd 
      Caption         =   "放弃"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   9
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   1485
      TabIndex        =   2
      Top             =   675
      Width           =   1185
   End
   Begin VB.CommandButton cmdOK 
      Caption         =   "确定"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   9
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   225
      TabIndex        =   1
      Top             =   675
      Width           =   1140
   End
   Begin VB.TextBox txtPwd 
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   9
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   330
      IMEMode         =   3  'DISABLE
      Left            =   135
      PasswordChar    =   "*"
      TabIndex        =   0
      Top             =   180
      Width           =   2625
   End
End
Attribute VB_Name = "frmPwd"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim strPwd As String

Private Sub cmdEnd_Click()
End
End Sub

Private Sub cmdOK_Click()
If txtPwd.Text = strPwd Then
 frmMain.Show
 Unload Me
Else
 MsgBox "密码错误!", 48, "提示"
 txtPwd.SelStart = 0
 txtPwd.SelLength = Len(txtPwd.Text)
 txtPwd.SetFocus
End If

End Sub

Private Sub Form_Load()
cmdOK.Enabled = False

rstPwd.Open "Select * from pwd", cnn, adOpenStatic, adLockOptimistic
rstPwd.MoveFirst
strPwd = rstPwd.Fields("密码")
rstPwd.Close

End Sub

Private Sub txtPwd_Change()
cmdOK.Enabled = True

End Sub

Private Sub txtPwd_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
 cmdOK_Click
End If
End Sub

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -