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

📄 glyklsg.frm

📁 vb数据库编程资料
💻 FRM
字号:
VERSION 5.00
Begin VB.Form glyklsg 
   Caption         =   "Form1"
   ClientHeight    =   1680
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   3825
   LinkTopic       =   "Form1"
   ScaleHeight     =   1680
   ScaleWidth      =   3825
   StartUpPosition =   3  '窗口缺省
   Begin VB.Data Data1 
      Caption         =   "Data1"
      Connect         =   "Access"
      DatabaseName    =   ""
      DefaultCursorType=   0  '缺省游标
      DefaultType     =   2  '使用 ODBC
      Exclusive       =   0   'False
      Height          =   285
      Left            =   600
      Options         =   0
      ReadOnly        =   0   'False
      RecordsetType   =   1  'Dynaset
      RecordSource    =   ""
      Top             =   1440
      Width           =   1455
   End
   Begin VB.TextBox Text3 
      Height          =   270
      IMEMode         =   3  'DISABLE
      Left            =   1800
      MaxLength       =   8
      PasswordChar    =   "*"
      TabIndex        =   5
      Top             =   1200
      Width           =   1455
   End
   Begin VB.TextBox Text2 
      Height          =   270
      IMEMode         =   3  'DISABLE
      Left            =   1800
      MaxLength       =   8
      PasswordChar    =   "*"
      TabIndex        =   4
      Top             =   720
      Width           =   1455
   End
   Begin VB.TextBox Text1 
      Height          =   270
      IMEMode         =   3  'DISABLE
      Left            =   1800
      MaxLength       =   8
      PasswordChar    =   "*"
      TabIndex        =   3
      Top             =   240
      Width           =   1455
   End
   Begin VB.Label Label3 
      Caption         =   "请再输入新口令:"
      Height          =   375
      Left            =   240
      TabIndex        =   2
      Top             =   1200
      Width           =   1455
   End
   Begin VB.Label Label2 
      Caption         =   "请输入新口令:"
      Height          =   375
      Left            =   240
      TabIndex        =   1
      Top             =   720
      Width           =   1335
   End
   Begin VB.Label Label1 
      Caption         =   "请输入旧口令:"
      Height          =   255
      Left            =   240
      TabIndex        =   0
      Top             =   240
      Width           =   1335
   End
End
Attribute VB_Name = "glyklsg"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private time As Integer
Private Sub Form_Load()
  Data1.DatabaseName = App.Path + "\tsglxx.mdb"
  Data1.RecordSource = "yhxx"
  time = 0
End Sub

Private Sub Text1_KeyPress(KeyAscii As Integer)
   If KeyAscii = 13 Then
      Call Text1_LostFocus
   End If
End Sub

Private Sub Text1_LostFocus()
  Data1.Recordset.MoveFirst
  
  If Text1.Text <> Data1.Recordset.Fields("userpass") Then
      time = time + 1
      If time < 3 Then
         MsgBox ("口令输入错误,请重新输入")
         Text1.Text = ""
         Text1.SetFocus
      Else
         MsgBox ("对不起,你无法修改该口令")
         Unload Me
      End If
   Else
      Text2.SetFocus
      time = 0
   End If
End Sub

Private Sub Text2_KeyPress(KeyAscii As Integer)
  If KeyAscii = 13 Then
     Text3.SetFocus
  End If
End Sub

Private Sub Text2_LostFocus()
   Text3.SetFocus
End Sub

Private Sub Text3_KeyPress(KeyAscii As Integer)
   If KeyPress = 13 Then
      If Text2.Text <> Text3.Text Then
         MsgBox ("两次输入的口令不一致,请重新输入")
         Text2.SetFocus
      Else
         Data1.Recordset.Edit
         Data1.Recordset.Fields("userpass") = Text2.Text
         Data1.Recordset.Update
         MsgBox ("口令修改成功")
      End If
   End If
End Sub

⌨️ 快捷键说明

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