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

📄 forgetpassword.frm

📁 希望给大家看看,能有点启发,是关于一个学生档案管理系统的文档.
💻 FRM
字号:
VERSION 5.00
Begin VB.Form ForgetPassword 
   BackColor       =   &H8000000A&
   Caption         =   "忘记密码"
   ClientHeight    =   4035
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   4890
   LinkTopic       =   "Form1"
   ScaleHeight     =   4035
   ScaleWidth      =   4890
   StartUpPosition =   3  '窗口缺省
   Begin VB.Frame Frame1 
      BackColor       =   &H8000000A&
      Caption         =   "请填写以下信息"
      Height          =   3015
      Left            =   240
      TabIndex        =   6
      Top             =   240
      Width           =   3855
      Begin VB.Data Data1 
         Caption         =   "Data1"
         Connect         =   "Access"
         DatabaseName    =   "userInformation.mdb"
         DefaultCursorType=   0  '缺省游标
         DefaultType     =   2  '使用 ODBC
         Exclusive       =   0   'False
         Height          =   375
         Left            =   840
         Options         =   0
         ReadOnly        =   0   'False
         RecordsetType   =   1  'Dynaset
         RecordSource    =   "用户信息"
         Top             =   2520
         Visible         =   0   'False
         Width           =   2175
      End
      Begin VB.TextBox Text4 
         Height          =   375
         Left            =   1440
         TabIndex        =   3
         Top             =   2040
         Width           =   1815
      End
      Begin VB.TextBox Text3 
         Height          =   375
         Left            =   1440
         TabIndex        =   2
         Top             =   1440
         Width           =   1815
      End
      Begin VB.TextBox Text2 
         Height          =   375
         Left            =   1440
         TabIndex        =   1
         Top             =   840
         Width           =   1815
      End
      Begin VB.TextBox Text1 
         Height          =   375
         Left            =   1440
         TabIndex        =   0
         Top             =   240
         Width           =   1815
      End
      Begin VB.Label Label4 
         BackStyle       =   0  'Transparent
         Caption         =   "身份证号"
         Height          =   255
         Left            =   240
         TabIndex        =   10
         Top             =   2160
         Width           =   975
      End
      Begin VB.Label Label3 
         BackStyle       =   0  'Transparent
         Caption         =   "回答问题"
         Height          =   255
         Left            =   240
         TabIndex        =   9
         Top             =   1560
         Width           =   1095
      End
      Begin VB.Label Label2 
         BackStyle       =   0  'Transparent
         Caption         =   "提示问题"
         Height          =   255
         Left            =   240
         TabIndex        =   8
         Top             =   960
         Width           =   975
      End
      Begin VB.Label Label1 
         BackStyle       =   0  'Transparent
         Caption         =   "用户名"
         Height          =   255
         Left            =   240
         TabIndex        =   7
         Top             =   360
         Width           =   855
      End
   End
   Begin VB.CommandButton Command2 
      Caption         =   "返回"
      Height          =   495
      Left            =   3480
      TabIndex        =   5
      Top             =   3360
      Width           =   975
   End
   Begin VB.CommandButton Command1 
      Caption         =   "提交"
      Default         =   -1  'True
      Height          =   495
      Left            =   2280
      TabIndex        =   4
      Top             =   3360
      Width           =   975
   End
End
Attribute VB_Name = "ForgetPassword"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
 Dim str As String
Private Sub Command1_Click()
     If Text4.Text = "" Then
         MsgBox "请填写完整!", vbOKOnly + vbExclamation, "提示"
         Text4.SetFocus
     Else
         Me.Data1.Recordset.FindFirst "身份证号='" & Text4.Text & "'"
         If Me.Data1.Recordset.NoMatch Then
            MsgBox "你填写的身份信息不对!", vbOKOnly + vbExclamation, "错误提示"
            Me.Data1.RecordSource = "用户信息"
            Me.Data1.Refresh
            Text4.Text = ""
            Text4.SetFocus
         Else
            
            Me.Data1.RecordSource = "Select 确认密码 From 用户信息"
            Me.Data1.Refresh
            MsgBox "你的密码是:" + Me.Data1.Recordset.Fields("确认密码"), vbOKOnly + vbInformation, "密码提示"
        End If
     End If
End Sub

Private Sub Command2_Click()
  Me.Hide
  pass.Show
End Sub

Private Sub Text1_LostFocus()
 If Text1.Text <> "" Then
    Me.Data1.RecordSource = "Select * From 用户信息 Where 用户名='" & Text1.Text & " '"
    Me.Data1.Refresh
    If Me.Data1.Recordset.EOF Then
       MsgBox "不存在这个用户,请先登陆!", vbOKOnly + vbExclamation, "错误警告"
       Me.Data1.RecordSource = "用户信息"
       Me.Data1.Refresh
       Text1.Text = ""
       Text1.SetFocus
    Else
       Text2.SetFocus
    End If
   Else
    Text2.Enabled = False: Text3.Enabled = False: Text4.Enabled = False
   End If
End Sub


Private Sub Text2_LostFocus()
  If Text2.Text <> "" Then
    Me.Data1.RecordSource = "Select * From 用户信息 Where 提示问题='" & Text2.Text & "'"
    Me.Data1.Refresh
    If Me.Data1.Recordset.EOF Then
      MsgBox "你提出的问题不对!", vbOKOnly + vbExclamation, "错误提示"
      Me.Data1.RecordSource = "用户信息"
      Me.Data1.Refresh
      Text2.Text = ""
      Text2.SetFocus
    End If
  
  End If
End Sub

Private Sub Text3_LostFocus()
  If Text3.Text <> "" Then
    Me.Data1.RecordSource = "Select * From 用户信息 Where 回答问题='" & Text3.Text & "'"
    Me.Data1.Refresh
    If Me.Data1.Recordset.EOF Then
      MsgBox "你回答的问题不对!", vbOKOnly + vbExclamation, "错误提示"
      Me.Data1.RecordSource = "用户信息"
      Me.Data1.Refresh
      Text3.Text = ""
      Text3.SetFocus
    End If
  
  End If
End Sub


⌨️ 快捷键说明

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