📄 frmpass.frm
字号:
VERSION 5.00
Begin VB.Form frmpass
BorderStyle = 1 'Fixed Single
Caption = "身份验证"
ClientHeight = 2100
ClientLeft = 45
ClientTop = 330
ClientWidth = 5370
Icon = "frmpass.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
Picture = "frmpass.frx":0442
ScaleHeight = 2100
ScaleWidth = 5370
StartUpPosition = 2 '屏幕中心
Begin VB.TextBox Text3
Height = 345
IMEMode = 3 'DISABLE
Left = 3555
PasswordChar = "*"
TabIndex = 7
Top = 1140
Visible = 0 'False
Width = 1665
End
Begin VB.CommandButton Comca
Caption = "取消"
Height = 390
Left = 3015
TabIndex = 3
Top = 1560
Width = 1140
End
Begin VB.CommandButton Comok
Caption = "确定"
Height = 390
Left = 1065
TabIndex = 2
Top = 1575
Width = 1155
End
Begin VB.TextBox Text1
Height = 390
IMEMode = 3 'DISABLE
Left = 1650
MaxLength = 8
PasswordChar = "*"
TabIndex = 0
Top = 645
Width = 2250
End
Begin VB.TextBox Text2
Height = 345
IMEMode = 3 'DISABLE
Left = 855
PasswordChar = "*"
TabIndex = 6
Top = 1140
Visible = 0 'False
Width = 1515
End
Begin VB.Label Label4
Caption = "再输入一次:"
Height = 225
Left = 2475
TabIndex = 9
Top = 1200
Visible = 0 'False
Width = 1200
End
Begin VB.Label Label3
Caption = "新密码:"
Height = 300
Left = 105
TabIndex = 8
Top = 1155
Visible = 0 'False
Width = 750
End
Begin VB.Line Line4
BorderColor = &H80000009&
Visible = 0 'False
X1 = 4245
X2 = 4245
Y1 = 660
Y2 = 930
End
Begin VB.Line Line3
Visible = 0 'False
X1 = 5055
X2 = 5055
Y1 = 660
Y2 = 945
End
Begin VB.Line Line2
Visible = 0 'False
X1 = 4230
X2 = 5070
Y1 = 930
Y2 = 930
End
Begin VB.Line Line1
BorderColor = &H80000009&
Visible = 0 'False
X1 = 4245
X2 = 5070
Y1 = 645
Y2 = 645
End
Begin VB.Label Label2
BackColor = &H8000000B&
Caption = "更改密码"
ForeColor = &H000000FF&
Height = 180
Left = 4320
TabIndex = 5
Top = 720
Width = 720
End
Begin VB.Label Label1
BackStyle = 0 'Transparent
Caption = "欢迎使用个人财务管理系统"
BeginProperty Font
Name = "宋体"
Size = 14.25
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H000000FF&
Height = 375
Index = 1
Left = 960
TabIndex = 4
Top = 120
Width = 4545
End
Begin VB.Label Label1
Caption = "请输入密码:"
Height = 360
Index = 0
Left = 315
TabIndex = 1
Top = 660
Width = 1230
End
End
Attribute VB_Name = "frmpass"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Public grzbpass As String
Private Sub Comca_Click()
Unload Me
End
End Sub
Private Sub Comok_Click()
grzbpass = Text1.Text
If Label3.Visible = True Then
If Text2.Text = Text3.Text Then
Dim i As Byte, pas(7) As String, mw
mw = ""
For i = 1 To Len(Text2.Text)
pas(i - 1) = Mid(Text2.Text, i, 1)
pas(i - 1) = Chr(Asc(pas(i - 1)) + 50 + i * 2)
mw = mw + pas(i - 1)
Next i
Open App.Path + "\ok.pas" For Output As #1
Write #1, mw
Close #1
Else
MsgBox "两次输入的密码不相同,请重输。", 48, "提示"
Text3.Text = ""
With Text2
.Text = ""
.SetFocus
End With
Exit Sub
End If
End If
Unload Me
End Sub
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Line1.Visible = False
Line2.Visible = False
Line3.Visible = False
Line4.Visible = False
Line1.BorderColor = &H80000009
Line2.BorderColor = &H80000008
Line3.BorderColor = &H80000008
Line4.BorderColor = &H80000009
End Sub
Private Sub Label2_Click()
If Module1.mw <> Text1.Text Then
MsgBox "请先输入正确的密码!"
Text1.SelStart = 0
Text1.SelLength = 8
Text1.SetFocus
Else
Label3.Visible = True
Label4.Visible = True
Label5.Visible = False
Text2.Visible = True
Text3.Visible = True
Text2.SetFocus
End If
End Sub
Private Sub Label2_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = 1 Then
Line2.BorderColor = &H80000009
Line1.BorderColor = &H80000008
Line4.BorderColor = &H80000008
Line3.BorderColor = &H80000009
End If
End Sub
Private Sub Label2_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Line1.Visible = True
Line2.Visible = True
Line3.Visible = True
Line4.Visible = True
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -