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

📄 frmapwd.frm

📁 第一次用VB编写的图书管理系统,仅供大家参考,呵呵,不足之处多多包含
💻 FRM
字号:
VERSION 5.00
Begin VB.Form FrmApwd 
   Caption         =   "修改密码"
   ClientHeight    =   2400
   ClientLeft      =   5010
   ClientTop       =   2670
   ClientWidth     =   3285
   LinkTopic       =   "Form1"
   LockControls    =   -1  'True
   MaxButton       =   0   'False
   ScaleHeight     =   2400
   ScaleWidth      =   3285
   Begin VB.CommandButton CmdC 
      Caption         =   "取消(&C)"
      Height          =   375
      Left            =   1800
      TabIndex        =   4
      Top             =   1800
      Width           =   975
   End
   Begin VB.CommandButton CmdM 
      Caption         =   "确 认(&O)"
      Height          =   375
      Left            =   360
      TabIndex        =   3
      Top             =   1800
      Width           =   975
   End
   Begin VB.TextBox txtpwd 
      ForeColor       =   &H00FF0000&
      Height          =   270
      IMEMode         =   3  'DISABLE
      Index           =   0
      Left            =   1080
      PasswordChar    =   "*"
      TabIndex        =   0
      Top             =   360
      Width           =   1815
   End
   Begin VB.TextBox txtpwd 
      ForeColor       =   &H000000FF&
      Height          =   270
      IMEMode         =   3  'DISABLE
      Index           =   1
      Left            =   1080
      PasswordChar    =   "*"
      TabIndex        =   1
      Top             =   840
      Width           =   1815
   End
   Begin VB.TextBox txtpwd 
      ForeColor       =   &H000000FF&
      Height          =   270
      IMEMode         =   3  'DISABLE
      Index           =   2
      Left            =   1080
      PasswordChar    =   "*"
      TabIndex        =   2
      Top             =   1320
      Width           =   1815
   End
   Begin VB.Label lbl 
      AutoSize        =   -1  'True
      Caption         =   "原密码"
      Height          =   180
      Left            =   240
      TabIndex        =   7
      Top             =   405
      Width           =   540
   End
   Begin VB.Label Label2 
      AutoSize        =   -1  'True
      Caption         =   "新密码"
      Height          =   180
      Left            =   240
      TabIndex        =   6
      Top             =   885
      Width           =   540
   End
   Begin VB.Label Label3 
      AutoSize        =   -1  'True
      Caption         =   "确认密码"
      Height          =   180
      Left            =   240
      TabIndex        =   5
      Top             =   1365
      Width           =   720
   End
End
Attribute VB_Name = "FrmApwd"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub CmdC_Click()
Unload Me
End Sub

Private Sub CmdM_Click()
If txtpwd(1) <> txtpwd(2) Then
  MsgBox "确认密码和新密码不同!", vbInformation, "修改错误"
  txtpwd(1) = Empty: txtpwd(2) = Empty: txtpwd(1).SetFocus: Exit Sub
End If
If FrmAdmini.bytPwd = 1 Then
    Call QueryInfo("select pwd from Administrator where name='" & FrmAdmini.Admini & "'")
    If DBRct.Fields("pwd") = Choose(txtpwd(0)) Then
     Call ExecuteSQL("update administrator set pwd='" & Choose(txtpwd(1)) & "' where name='" & FrmAdmini.Admini & "'")
    Else: MsgBox "密码输入有误!", vbInformation, "密码出错": txtpwd(0) = "": txtpwd(0).SetFocus: Exit Sub
    End If
Else
 Call QueryInfo("select readername from readers where readerid='" & Choose(txtpwd(0)) & "'")
  If DBRct.EOF = True Then MsgBox "学生编号不存在!", vbInformation, "出错": Exit Sub
 Call ExecuteSQL("update readers set pwd='" & Choose(txtpwd(1)) & "' where readerid='" & Choose(txtpwd(0)) & "'")
End If
MsgBox " 修改密码成功!", vbInformation, "修改密码"
Unload Me
End Sub

Private Sub Form_Load()
If FrmAdmini.bytPwd = 2 Then lbl.Caption = "学生学号": txtpwd(0).PasswordChar = Empty
End Sub

Private Sub Form_Resize()
If Me.Height <= 500 Or Me.Width <= 1500 Then Exit Sub
Me.Height = 2820
Me.Width = 3405
End Sub

Private Sub txtpwd_Change(Index As Integer)
If txtpwd(0) <> Empty And txtpwd(1) <> Empty And txtpwd(2) <> Empty Then CmdM.Enabled = True Else CmdM.Enabled = False
End Sub

Private Sub txtpwd_KeyPress(Index As Integer, KeyAscii As Integer)
If KeyAscii = 13 And CmdM.Enabled = True Then CmdM_Click
End Sub

⌨️ 快捷键说明

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