passform.frm

来自「一套VB完整的灯具销售管理系统设计」· FRM 代码 · 共 137 行

FRM
137
字号
VERSION 5.00
Begin VB.Form passForm 
   AutoRedraw      =   -1  'True
   BackColor       =   &H00000040&
   BorderStyle     =   3  'Fixed Dialog
   ClientHeight    =   1485
   ClientLeft      =   45
   ClientTop       =   45
   ClientWidth     =   4680
   ControlBox      =   0   'False
   LinkTopic       =   "Form1"
   LockControls    =   -1  'True
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   1485
   ScaleWidth      =   4680
   ShowInTaskbar   =   0   'False
   StartUpPosition =   2  'CenterScreen
   Begin VB.CommandButton closeform 
      Cancel          =   -1  'True
      Caption         =   "取消(&C)"
      Height          =   345
      Left            =   3435
      TabIndex        =   5
      Top             =   780
      Width           =   990
   End
   Begin VB.CommandButton SURE 
      Caption         =   "确认(&O)"
      Height          =   345
      Left            =   3435
      TabIndex        =   4
      Top             =   315
      Width           =   990
   End
   Begin VB.TextBox verifyPass 
      Height          =   270
      IMEMode         =   3  'DISABLE
      Left            =   1455
      MaxLength       =   16
      PasswordChar    =   "*"
      TabIndex        =   3
      Top             =   780
      Width           =   1530
   End
   Begin VB.TextBox newpass 
      Height          =   270
      IMEMode         =   3  'DISABLE
      Left            =   1455
      MaxLength       =   16
      PasswordChar    =   "*"
      TabIndex        =   1
      Top             =   360
      Width           =   1530
   End
   Begin VB.Label Label2 
      AutoSize        =   -1  'True
      BackStyle       =   0  'Transparent
      Caption         =   "确认新口令:"
      ForeColor       =   &H0000FFFF&
      Height          =   180
      Left            =   375
      TabIndex        =   2
      Top             =   870
      Width           =   1080
   End
   Begin VB.Label Label1 
      AutoSize        =   -1  'True
      BackStyle       =   0  'Transparent
      Caption         =   "新口令:"
      ForeColor       =   &H0000FFFF&
      Height          =   180
      Left            =   735
      TabIndex        =   0
      Top             =   405
      Width           =   720
   End
End
Attribute VB_Name = "passForm"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub CloseForm_Click()
Unload Me
End Sub
Private Sub newpass_KeyPress(KeyAscii As Integer)
  If KeyAscii = 13 Then
     verifyPass.SetFocus
     End If
End Sub

Private Sub Sure_Click()
'如果新口令与确认口令有一个为空时执行
If Trim(newpass.Text) = "" Or Trim(verifyPass.Text) = "" Then
   MsgBox "新口令与确认口令有一个或两为空!", vbOKOnly + 32, "口令错误"
   newpass.SetFocus
   Exit Sub
   End If
'检验新口令与确认口令是否相符
If Trim(newpass.Text) = Trim(verifyPass.Text) Then

   '将口令改成其它形式,加密
   Dim shiftStr As String, shiftStrL As String, shiftStrR As String, shiftNum As Integer, ili As Integer, TempStr As String, sureStr As String
      shiftStr = Trim(newpass.Text)
      shiftNum = Len(shiftStr)
      ili = 1
      sureStr = ""
      TempStr = ""
      For ili = shiftNum To 1 Step -1
        shiftStrR = Right(shiftStr, ili)
         shiftStrL = Left(shiftStrR, 1)
           If Asc(shiftStrL) < 100 Then
           TempStr = Asc(shiftStrL) & Asc("y")
           TempStr = "0" & TempStr
           Else
           TempStr = Asc(shiftStrL) & Asc("y")
           End If
             sureStr = sureStr & TempStr
               Next
            Jsrform1.passwords.Text = sureStr
            Unload Me
            Exit Sub
        Else
            MsgBox "新口令与确认口令不符合!", vbOKOnly + 32, "口令错误"
            verifyPass.SetFocus
             Exit Sub
          End If

End Sub

Private Sub verifyPass_KeyPress(KeyAscii As Integer)
  If KeyAscii = 13 Then
     Sure.SetFocus
     End If
End Sub

⌨️ 快捷键说明

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