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

📄 frmchgpass.frm

📁 程序加密算法
💻 FRM
📖 第 1 页 / 共 2 页
字号:
VERSION 5.00
Begin VB.Form frmChgPass 
   BorderStyle     =   1  'Fixed Single
   ClientHeight    =   3735
   ClientLeft      =   1560
   ClientTop       =   1845
   ClientWidth     =   5550
   Icon            =   "frmChgPass.frx":0000
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   PaletteMode     =   1  'UseZOrder
   ScaleHeight     =   3735
   ScaleWidth      =   5550
   ShowInTaskbar   =   0   'False
   Begin VB.CommandButton cmdChoice 
      Caption         =   "&OK"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Index           =   1
      Left            =   4440
      TabIndex        =   5
      Top             =   2460
      Width           =   975
   End
   Begin VB.TextBox txtPassword 
      Height          =   315
      IMEMode         =   3  'DISABLE
      Index           =   0
      Left            =   840
      MaxLength       =   15
      TabIndex        =   0
      Top             =   1080
      Width           =   3435
   End
   Begin VB.TextBox txtPassword 
      BackColor       =   &H00FFFFFF&
      Height          =   285
      IMEMode         =   3  'DISABLE
      Index           =   1
      Left            =   180
      MaxLength       =   250
      PasswordChar    =   "*"
      TabIndex        =   1
      Top             =   1800
      Width           =   4095
   End
   Begin VB.CommandButton cmdChoice 
      Caption         =   "&Cancel"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Index           =   2
      Left            =   4440
      TabIndex        =   6
      Top             =   2925
      Width           =   975
   End
   Begin VB.CommandButton cmdChoice 
      Caption         =   "&OK"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Index           =   0
      Left            =   4440
      TabIndex        =   4
      Top             =   2460
      Width           =   975
   End
   Begin VB.TextBox txtPassword 
      Height          =   285
      IMEMode         =   3  'DISABLE
      Index           =   3
      Left            =   180
      MaxLength       =   250
      PasswordChar    =   "*"
      TabIndex        =   3
      Top             =   3000
      Width           =   4095
   End
   Begin VB.TextBox txtPassword 
      BackColor       =   &H00FFFFFF&
      Height          =   285
      IMEMode         =   3  'DISABLE
      Index           =   2
      Left            =   180
      MaxLength       =   250
      PasswordChar    =   "*"
      TabIndex        =   2
      Top             =   2400
      Width           =   4095
   End
   Begin VB.Label Label2 
      Alignment       =   1  'Right Justify
      AutoSize        =   -1  'True
      BackStyle       =   0  'Transparent
      Caption         =   "User ID"
      Height          =   195
      Index           =   0
      Left            =   180
      TabIndex        =   12
      Top             =   1185
      Width           =   540
   End
   Begin VB.Label lblTitle 
      Alignment       =   2  'Center
      BackColor       =   &H00C00000&
      BorderStyle     =   1  'Fixed Single
      Caption         =   "Change User Password"
      BeginProperty Font 
         Name            =   "Times New Roman"
         Size            =   24
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   -1  'True
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00FFFFFF&
      Height          =   705
      Left            =   180
      TabIndex        =   11
      Top             =   180
      Width           =   5250
   End
   Begin VB.Label lblMyLabel 
      BackStyle       =   0  'Transparent
      Height          =   240
      Left            =   240
      TabIndex        =   10
      Top             =   3420
      Width           =   3600
   End
   Begin VB.Label Label5 
      BackStyle       =   0  'Transparent
      Caption         =   "Password / Passphrase (From here, click OK)"
      Height          =   255
      Left            =   225
      TabIndex        =   9
      Top             =   1560
      Width           =   4065
   End
   Begin VB.Label Label3 
      BackStyle       =   0  'Transparent
      Caption         =   "Verify Password/Passphrase"
      Height          =   255
      Left            =   240
      TabIndex        =   8
      Top             =   2760
      Width           =   3750
   End
   Begin VB.Label Label2 
      BackStyle       =   0  'Transparent
      Caption         =   "New Password / Passphrase"
      Height          =   255
      Index           =   1
      Left            =   225
      TabIndex        =   7
      Top             =   2160
      Width           =   3825
   End
End
Attribute VB_Name = "frmChgPass"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit

' ===========================================================================
'    DATE      NAME                      DESCRIPTION
' -----------  ------------------------  ------------------------------------
' 30-DEC-2000  Kenneth Ives              Written by kenaso@home.com
' ---------------------------------------------------------------------------
' Define module level variables
' ---------------------------------------------------------------------------
  Private arUserID()   As Byte
  Private arPWord1()   As Byte
  Private arPWord2()   As Byte
  Private arPWord3()   As Byte
  Private m_strUserID  As String
  Private m_strPWord1  As String
  Private m_strPWord2  As String
  Private m_strPWord3  As String
  
Private Sub Button_Lock(blnLockout As Boolean)

  If blnLockout Then
      With frmChgPass
           ' the two OK buttons must be reset
           .cmdChoice(1).Enabled = False
           .cmdChoice(1).Visible = False
           
           .cmdChoice(0).Enabled = True
           .cmdChoice(0).Visible = True
        
           ' Enable top two text boxes
           ' and update their color
           .txtPassword(1).Enabled = True
           .txtPassword(1).BackColor = vbWhite
           .txtPassword(1).Text = ""
        
           ' disable bottom two text boxes
           .txtPassword(2).Text = ""
           .txtPassword(2).BackColor = vbBlack
           .txtPassword(2).Enabled = False
           .txtPassword(3).Text = ""
           .txtPassword(3).BackColor = vbBlack
           .txtPassword(3).Enabled = False
      End With
      
      ' Empty the password arrays
      Erase arPWord1()
      Erase arPWord2()
      Erase arPWord3()
      m_strPWord1 = ""
      m_strPWord2 = ""
      m_strPWord3 = ""
      m_strUserID = ""
      
  Else
      ' allow data input into bottom two text boxes
      With frmChgPass
           ' the two OK buttons must be reset
           .cmdChoice(0).Enabled = False
           .cmdChoice(0).Visible = False
           .cmdChoice(1).Enabled = True
           .cmdChoice(1).Visible = True
                    
           ' locak out the top two boxes
           .txtPassword(0).Enabled = False
           .txtPassword(0).BackColor = vbCyan
           .txtPassword(1).Enabled = False
           .txtPassword(1).BackColor = vbCyan
           
           ' Enable bottom two text boxes
           ' and update their color
           .txtPassword(2).Enabled = True
           .txtPassword(2).BackColor = vbWhite
           .txtPassword(2).Text = ""
           .txtPassword(3).Enabled = True
           .txtPassword(3).BackColor = vbWhite
           .txtPassword(3).Text = ""
      End With
  
      ' Empty the password arrays
      Erase arPWord2()
      Erase arPWord3()
      m_strPWord2 = ""
      m_strPWord3 = ""
  End If
  
End Sub

Private Sub Clear_Bottom_Boxes()

' ---------------------------------------------------------------------------
' Empty the variables
' ---------------------------------------------------------------------------
  Erase arPWord2()
  Erase arPWord3()
  
  txtPassword(2).Text = ""
  txtPassword(3).Text = ""
  
  m_strPWord2 = ""
  m_strPWord3 = ""

End Sub

Private Sub cmdChoice_Click(Index As Integer)

' ---------------------------------------------------------------------------
' Define variables
' ---------------------------------------------------------------------------
  Dim strTmp1    As String
  Dim strTmp2    As String
  Dim intIndex   As Integer
  Dim intResp    As Integer
  
' ---------------------------------------------------------------------------
' Based on the button pressed
' ---------------------------------------------------------------------------
  Select Case Index
         
         ' OK button was pressed.  Time to test the input.
         Case 0:
              ' Test data input
              If Len(m_strUserID) = 0 Then
                  MsgBox "A user ID must be entered.", _
                         vbInformation Or vbOKOnly, "User ID missing"
                  txtPassword(0).Text = ""
                  txtPassword(0).SetFocus
                  Exit Sub
              Else
                  arUserID = ConvertToArray(m_strUserID)
              End If
                  
              ' Test length of password
              If Len(m_strPWord1) = 0 Then
                  MsgBox "A password / passphrase must be entered.", _
                         vbInformation Or vbOKOnly, "Password / Passphrase missing"
                  txtPassword(1).Text = ""
                  txtPassword(1).SetFocus
                  Exit Sub
              Else
                  arPWord1 = ConvertToArray(m_strPWord1)
              End If
                  
              ' Test length of password data entered
              If Not Correct_Password_Length(arPWord1()) Then
                  txtPassword(1).Text = ""
                  txtPassword(1).SetFocus
                  Exit Sub
              End If
              
              ' Is this user on file?
              If Not Query_User(arUserID(), strTmp1, strTmp2) Then
                  MsgBox "User [ " & m_strUserID & _
                         " ] cannot be found in the database.", _
                         vbInformation Or vbOKOnly, "Invalid User ID"
                  
                  ' get rid of any data returned
                  strTmp1 = String$(250, 0)
                  strTmp2 = String$(250, 0)
                  Reset_frmChgPass
                  Exit Sub
              Else
                  ' get rid of any data returned
                  strTmp1 = String$(250, 0)
                  strTmp2 = String$(250, 0)
              End If
              
              ' Hash the new password and compare with the
              ' the hashed results in the database.
              If Not Validate_Password(arUserID(), arPWord1()) Then
                  txtPassword(1).Text = ""
                  txtPassword(1).SetFocus
                  Exit Sub
              End If
              
              ' Reset the two OK buttons and enable
              ' bottom two text boxes
              Button_Lock False
              txtPassword(2).SetFocus
              Exit Sub

⌨️ 快捷键说明

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