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

📄 frmmodifypassword.frm

📁 本系统可用于医院和专业体检中心的健康体检管理
💻 FRM
字号:
VERSION 5.00
Object = "{0B81E4A9-BE4E-4AEF-9272-33AB5B51C6FC}#1.0#0"; "XPControls.ocx"
Begin VB.Form frmModifyPassword 
   BackColor       =   &H00D3DABC&
   BorderStyle     =   1  'Fixed Single
   Caption         =   "修改密码"
   ClientHeight    =   3315
   ClientLeft      =   45
   ClientTop       =   435
   ClientWidth     =   4815
   BeginProperty Font 
      Name            =   "MS Sans Serif"
      Size            =   9.75
      Charset         =   0
      Weight          =   400
      Underline       =   0   'False
      Italic          =   0   'False
      Strikethrough   =   0   'False
   EndProperty
   Icon            =   "frmModifyPassword.frx":0000
   LinkTopic       =   "Form1"
   LockControls    =   -1  'True
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   3315
   ScaleWidth      =   4815
   StartUpPosition =   1  '所有者中心
   Begin XPControls.XPCommandButton cmdCancel 
      Cancel          =   -1  'True
      Height          =   375
      Left            =   2670
      TabIndex        =   10
      Top             =   2790
      Width           =   1035
      _ExtentX        =   1826
      _ExtentY        =   661
      Caption         =   "取消(&C)"
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "MS Sans Serif"
         Size            =   9.75
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
   End
   Begin XPControls.XPCommandButton cmdOK 
      Height          =   375
      Left            =   1110
      TabIndex        =   9
      Top             =   2790
      Width           =   1035
      _ExtentX        =   1826
      _ExtentY        =   661
      Caption         =   "确定(&O)"
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "MS Sans Serif"
         Size            =   9.75
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
   End
   Begin VB.Frame Frame1 
      BackColor       =   &H00D3DABC&
      Caption         =   "密码信息"
      Height          =   2445
      Left            =   240
      TabIndex        =   3
      Top             =   180
      Width           =   4335
      Begin VB.TextBox txtOldPassword 
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   12
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   360
         IMEMode         =   3  'DISABLE
         Left            =   1860
         PasswordChar    =   "*"
         TabIndex        =   0
         Top             =   750
         Width           =   2265
      End
      Begin VB.TextBox txtNewPassword1 
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   12
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   360
         IMEMode         =   3  'DISABLE
         Left            =   1860
         PasswordChar    =   "*"
         TabIndex        =   1
         Top             =   1320
         Width           =   2265
      End
      Begin VB.TextBox txtNewPassword2 
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   12
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   360
         IMEMode         =   3  'DISABLE
         Left            =   1860
         PasswordChar    =   "*"
         TabIndex        =   2
         Top             =   1890
         Width           =   2265
      End
      Begin VB.Label Label1 
         AutoSize        =   -1  'True
         BackStyle       =   0  'Transparent
         Caption         =   "当前用户:"
         Height          =   240
         Left            =   930
         TabIndex        =   8
         Top             =   300
         Width           =   900
      End
      Begin VB.Label lblName 
         AutoSize        =   -1  'True
         BackStyle       =   0  'Transparent
         Caption         =   "lblName"
         Height          =   240
         Left            =   1920
         TabIndex        =   7
         Top             =   300
         Width           =   765
      End
      Begin VB.Label Label3 
         AutoSize        =   -1  'True
         BackStyle       =   0  'Transparent
         Caption         =   "请输入旧密码:"
         Height          =   240
         Left            =   570
         TabIndex        =   6
         Top             =   850
         Width           =   1260
      End
      Begin VB.Label Label4 
         AutoSize        =   -1  'True
         BackStyle       =   0  'Transparent
         Caption         =   "请输入新密码:"
         Height          =   240
         Left            =   570
         TabIndex        =   5
         Top             =   1400
         Width           =   1260
      End
      Begin VB.Label Label5 
         AutoSize        =   -1  'True
         BackStyle       =   0  'Transparent
         Caption         =   "请再次输入新密码:"
         Height          =   240
         Left            =   210
         TabIndex        =   4
         Top             =   1950
         Width           =   1620
      End
   End
End
Attribute VB_Name = "frmModifyPassword"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit

Private Sub cmdCancel_Click()
    Me.Hide
    Unload Me
End Sub

Private Sub cmdCancel_MouseMove(Button As Integer, Shift As Integer, x As Single, y As Single)
    ShowStatus "取消"
End Sub

Private Sub cmdOK_Click()
On Error GoTo ErrMsg
    Dim strPassword As String
    Dim strSQL As String
    Dim Status
    Dim rstemp As New ADODB.Recordset
    
    txtOldPassword.Text = CheckString(txtOldPassword.Text)
    txtNewPassword1.Text = CheckString(txtNewPassword1.Text)
    txtNewPassword2.Text = CheckString(txtNewPassword2.Text)
     
    If txtNewPassword1.Text <> txtNewPassword2.Text Then
        MsgBox "两次输入密码不一致,请重新输入!", vbInformation, "密码不一致"
        txtNewPassword1.SetFocus
        Exit Sub
    End If
    
    If Len(txtNewPassword1.Text) < 6 Then
        MsgBox "为了系统的安全性,密码长度不能低于六位。请重新输入!", vbInformation, "密码太短"
        txtNewPassword1.SetFocus
        Exit Sub
    End If
    
'    strPassword = "/" & Incode(txtOldPassword.Text) & "/"
    strPassword = txtOldPassword.Text
    strSQL = "select count(*) from RY_Employee where Name='" _
            & gstrManagerName & "' and Password='" & strPassword & "'"
    rstemp.Open strSQL, GCon, adOpenStatic, adLockReadOnly
    If rstemp(0) < 1 Then
        MsgBox "您输入的旧密码不对,请重新输入!", vbInformation, "旧密码错"
        txtOldPassword.SetFocus
        Exit Sub
    End If
    rstemp.Close
    Set rstemp = Nothing
    
'    strPassword = "/" & Incode(txtNewPassword1.Text) & "/"
    strPassword = txtNewPassword1.Text
    strSQL = "update RY_Employee set Password='" & strPassword _
            & "' where Name='" & gstrManagerName & "'"
    GCon.Execute strSQL
    
    MsgBox "密码修改成功!", vbInformation, "恭喜"
        
'    '添加到日志
'    AddLog gstrManagerName, "成功修改自己的密码", OperationLog

    cmdCancel_Click
    Exit Sub
ErrMsg:
    Status = SetError(Err.Number, Err.Description, Me.Caption & ".cmdOK_Click")
    ErrMsg Status
End Sub

Private Sub cmdOK_MouseMove(Button As Integer, Shift As Integer, x As Single, y As Single)
    ShowStatus "确定"
End Sub

Private Sub Form_Load()
    lblName.Caption = gstrManagerName
End Sub

Private Sub Form_MouseMove(Button As Integer, Shift As Integer, x As Single, y As Single)
    ShowStatus "Ready"
End Sub

Private Sub Form_Unload(Cancel As Integer)
    ShowStatus "Ready"
End Sub

Private Sub Frame1_MouseMove(Button As Integer, Shift As Integer, x As Single, y As Single)
    ShowStatus "密码信息"
End Sub

Private Sub txtNewPassword1_GotFocus()
    txtNewPassword1.SelStart = 0
    txtNewPassword1.SelLength = Len(txtNewPassword1.Text)
End Sub

Private Sub txtNewPassword1_KeyPress(KeyAscii As Integer)
    EnterToTab KeyAscii
End Sub

Private Sub txtNewPassword1_MouseMove(Button As Integer, Shift As Integer, x As Single, y As Single)
    ShowStatus "输入新密码"
End Sub

Private Sub txtNewPassword2_GotFocus()
    txtNewPassword2.SelStart = 0
    txtNewPassword2.SelLength = Len(txtNewPassword2.Text)
End Sub

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

Private Sub txtNewPassword2_MouseMove(Button As Integer, Shift As Integer, x As Single, y As Single)
    ShowStatus "再次输入新密码"
End Sub

Private Sub txtOldPassword_GotFocus()
    txtOldPassword.SelStart = 0
    txtOldPassword.SelLength = Len(txtOldPassword.Text)
End Sub

Private Sub txtOldPassword_KeyPress(KeyAscii As Integer)
    EnterToTab KeyAscii
End Sub

Private Sub txtOldPassword_MouseMove(Button As Integer, Shift As Integer, x As Single, y As Single)
    ShowStatus "输入旧密码"
End Sub

⌨️ 快捷键说明

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