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

📄 frmadduser.frm

📁 程序加密算法
💻 FRM
📖 第 1 页 / 共 2 页
字号:
VERSION 5.00
Begin VB.Form frmAddUser 
   BorderStyle     =   1  'Fixed Single
   ClientHeight    =   3075
   ClientLeft      =   1560
   ClientTop       =   1845
   ClientWidth     =   5565
   Icon            =   "frmAddUser.frx":0000
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   3075
   ScaleWidth      =   5565
   Begin VB.TextBox txtPassword 
      Height          =   315
      IMEMode         =   3  'DISABLE
      Index           =   2
      Left            =   180
      MaxLength       =   250
      PasswordChar    =   "*"
      TabIndex        =   2
      Top             =   2340
      Width           =   4095
   End
   Begin VB.TextBox txtPassword 
      Height          =   315
      IMEMode         =   3  'DISABLE
      Index           =   1
      Left            =   180
      MaxLength       =   250
      PasswordChar    =   "*"
      TabIndex        =   1
      Top             =   1740
      Width           =   4095
   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            =   4500
      TabIndex        =   3
      Top             =   1860
      Width           =   975
   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           =   1
      Left            =   4500
      TabIndex        =   4
      Top             =   2310
      Width           =   975
   End
   Begin VB.TextBox txtPassword 
      Height          =   315
      IMEMode         =   3  'DISABLE
      Index           =   0
      Left            =   840
      MaxLength       =   15
      TabIndex        =   0
      Top             =   1035
      Width           =   3435
   End
   Begin VB.Label Label2 
      AutoSize        =   -1  'True
      BackStyle       =   0  'Transparent
      Caption         =   "Verify Password / Passphrase"
      Height          =   195
      Index           =   2
      Left            =   240
      TabIndex        =   9
      Top             =   2100
      Width           =   2115
   End
   Begin VB.Label Label2 
      AutoSize        =   -1  'True
      BackStyle       =   0  'Transparent
      Caption         =   "New Password / Passphrase"
      Height          =   195
      Index           =   1
      Left            =   180
      TabIndex        =   8
      Top             =   1500
      Width           =   2055
   End
   Begin VB.Label lblMyLabel 
      BackStyle       =   0  'Transparent
      Height          =   240
      Left            =   240
      TabIndex        =   7
      Top             =   2760
      Width           =   3525
   End
   Begin VB.Label lblTitle 
      Alignment       =   2  'Center
      BackColor       =   &H00C00000&
      BorderStyle     =   1  'Fixed Single
      Caption         =   "Add  User"
      BeginProperty Font 
         Name            =   "Times New Roman"
         Size            =   27.75
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   -1  'True
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00FFFFFF&
      Height          =   765
      Left            =   120
      TabIndex        =   6
      Top             =   120
      Width           =   5370
   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        =   5
      Top             =   1140
      Width           =   540
   End
End
Attribute VB_Name = "frmAddUser"
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 m_strUserID  As String
  Private m_strPWord1  As String
  Private m_strPWord2  As String

Private Sub cmdChoice_Click(Index As Integer)

' ---------------------------------------------------------------------------
' Define variables
' ---------------------------------------------------------------------------
  Dim strTmp1 As String
  Dim strTmp2 As String
  
' ---------------------------------------------------------------------------
' Based on the button pressed
' ---------------------------------------------------------------------------
  Select Case Index
         
         ' OK button was pressed.
         Case 0:
              ' Test length of user ID
              If Len(m_strUserID) = 0 Then
                  MsgBox "A user ID must be entered.", _
                         vbInformation Or vbOKOnly, "User ID missing"
                  txtPassword(0).SetFocus
                  Exit Sub
              Else
                  arUserID = ConvertToArray(m_strUserID)
              End If
                  
              ' Test length of New password
              If Len(m_strPWord1) = 0 Then
                  MsgBox "A password / passphrase must be entered.", _
                         vbInformation Or vbOKOnly, "Password / Passphrase missing"
                  Reset_PWD_Boxes
                  txtPassword(1).SetFocus
                  Exit Sub
              Else
                  arPWord1 = ConvertToArray(m_strPWord1)
              End If
                  
              ' Test length of new password data entered
              If Not Correct_Password_Length(arPWord1()) Then
                  Reset_PWD_Boxes
                  txtPassword(1).SetFocus
                  Exit Sub
              End If
             
              ' Test length of verify password
              If Len(m_strPWord2) = 0 Then
                  MsgBox "A verification password / passphrase must be entered.", _
                         vbInformation Or vbOKOnly, "Password / Passphrase missing"
                  txtPassword(2).SetFocus
                  Exit Sub
              Else
                  arPWord2 = ConvertToArray(m_strPWord2)
              End If
                  
              ' Test length of verification password data entered
              If Not Correct_Password_Length(arPWord2()) Then
                  Erase arPWord2()
                  m_strPWord2 = ""
                  txtPassword(2).Text = ""
                  txtPassword(2).SetFocus
                  Exit Sub
              End If
             
              ' Is this user on file?
              If Query_User(arUserID(), strTmp1, strTmp2) Then
                  MsgBox "User [ " & m_strUserID & _
                         " ] is already in the database.", _
                         vbInformation Or vbOKOnly, "Duplicate User ID"
                  
                  ' get rid of any data returned
                  strTmp1 = String$(250, 0)
                  strTmp2 = String$(250, 0)
                  Reset_frmAddUser
                  Exit Sub
              Else
                  ' get rid of any data returned
                  strTmp1 = String$(250, 0)
                  strTmp2 = String$(250, 0)
              End If
              
              ' see if the passwords are the same
              If Not Same_As_Previous(arPWord1(), arPWord2()) Then
                  MsgBox "Password / Passphrase entries are not the same.", _
                         vbInformation Or vbOKOnly, "Invalid data entered"
                  Reset_PWD_Boxes
                  txtPassword(1).SetFocus
                  Exit Sub
              End If
              
              ' Add the new user to the database
              If Not AddNew_User(arUserID(), arPWord1()) Then
                  ' Return to the main menu.
                  Reset_frmAddUser
                  frmAddUser.Hide
                  frmMainMenu.Show
                  Exit Sub
              End If
              
              ' We were sucessful
              MsgBox "User [ " & m_strUserID & _
                     " ] has been added to the database.", _
                     vbInformation Or vbOKOnly, "Update Successful"
              Reset_frmAddUser
              
         ' Cancel button was pressed.
         Case 1:
              Reset_frmAddUser
              frmAddUser.Hide
              frmMainMenu.Show
  End Select
  
End Sub

⌨️ 快捷键说明

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