📄 password.frm
字号:
VERSION 5.00
Object = "{27634C13-AC02-4C0B-A31D-18DCAA87ABF7}#2.0#0"; "DLDATE.OCX"
Begin VB.Form password
BackColor = &H00F5A9A5&
BorderStyle = 1 'Fixed Single
Caption = "欢迎使用-密码输入"
ClientHeight = 3360
ClientLeft = 45
ClientTop = 330
ClientWidth = 5910
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Icon = "password.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 3360
ScaleWidth = 5910
StartUpPosition = 1 '所有者中心
Begin OsenXPControls2.CommandButton CommandButton2
Height = 420
Left = 4170
TabIndex = 11
Top = 2235
Width = 750
_ExtentX = 1323
_ExtentY = 741
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Caption = "放 弃 "
ForeColor = 16711680
ForeHover = 4210688
End
Begin OsenXPControls2.CommandButton CommandButton1
Height = 405
Left = 1140
TabIndex = 10
Top = 2250
Width = 720
_ExtentX = 1270
_ExtentY = 714
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Caption = "确 认 "
ForeColor = 16711680
ForeHover = 4210688
End
Begin VB.TextBox Text3
BackColor = &H00F5A9A5&
Height = 360
IMEMode = 3 'DISABLE
Left = 2955
MaxLength = 8
PasswordChar = "*"
TabIndex = 7
Top = 1410
Width = 1620
End
Begin VB.TextBox Text2
BackColor = &H00F5A9A5&
Height = 345
IMEMode = 3 'DISABLE
Left = 4395
MaxLength = 8
PasswordChar = "*"
TabIndex = 5
Top = 1350
Width = 1155
End
Begin VB.TextBox Text1
BackColor = &H00F5A9A5&
Height = 345
IMEMode = 3 'DISABLE
Left = 1845
MaxLength = 8
PasswordChar = "*"
TabIndex = 3
Top = 1350
Width = 1155
End
Begin VB.Label Label6
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "提示:取消密码功能,直接按“确认”"
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H000000FF&
Height = 180
Left = 135
TabIndex = 9
Top = 3090
Width = 3060
End
Begin VB.Label Label5
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "(枫叶工作室 李占锋作品)"
BeginProperty Font
Name = "楷体_GB2312"
Size = 10.5
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00404000&
Height = 210
Left = 1560
TabIndex = 8
Top = 735
Width = 2835
End
Begin VB.Label Label4
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "请输入您的密码:"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FF0000&
Height = 240
Left = 885
TabIndex = 6
Top = 1485
Width = 1800
End
Begin VB.Label Label3
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "确认密码:"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FF0000&
Height = 210
Left = 3420
TabIndex = 4
Top = 1470
Width = 945
End
Begin VB.Label Label2
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "您的用户密码:"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FF0000&
Height = 210
Left = 360
TabIndex = 2
Top = 1470
Width = 1365
End
Begin VB.Label Label1
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "欢迎使用 我的收支管理1.0版"
BeginProperty Font
Name = "宋体"
Size = 18
Charset = 134
Weight = 700
Underline = 0 'False
Italic = -1 'True
Strikethrough = 0 'False
EndProperty
ForeColor = &H00000000&
Height = 360
Index = 1
Left = 405
TabIndex = 1
Top = 240
Width = 4920
End
Begin VB.Label Label1
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "欢迎使用 我的收支管理1.0版"
BeginProperty Font
Name = "宋体"
Size = 18
Charset = 134
Weight = 700
Underline = 0 'False
Italic = -1 'True
Strikethrough = 0 'False
EndProperty
ForeColor = &H000000FF&
Height = 360
Index = 0
Left = 405
TabIndex = 0
Top = 270
Width = 4920
End
End
Attribute VB_Name = "password"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim i As Integer
Dim pas(7) As String
Dim n As Integer
Dim ret As String
Private Sub Command1_Click()
End Sub
Private Sub Command2_Click()
End Sub
Private Sub CommandButton1_Click()
If ret = "first" Then
If Text1.Text = "" And Text2.Text = "" Then
SaveSetting "yonghu", "start", "word", "nopass"
Load mainfrm
mainfrm.Show
Unload Me
Exit Sub
Else
SaveSetting "yonghu", "start", "word", "pass"
End If
If Text2.Text <> Text1.Text Then
MsgBox "两次输入的密码不相同,请重输。", 48, "提示"
With Text2
.SelStart = 0
.SelLength = Len(.Text)
.SetFocus
End With
Exit Sub
End If
mm = ""
For i = 1 To Len(Text1.Text)
pas(i - 1) = Mid(Text1.Text, i, 1)
pas(i - 1) = Chr(Asc(pas(i - 1)) + i)
mm = mm + pas(i - 1)
Next i
Load mainfrm
mainfrm.Show
Unload Me
Open App.Path + "\ok.psa" For Output As #1
Write #1, mm
Close #1
Else
If ret = "pass" Then
If Dir(App.Path + "/OK.psa") <> "ok.psa" Then '保存密码的文件不在
MsgBox "程序文件出错,请重新安装.", 32, "出错"
End
Else
mm = ""
Open App.Path + "/ok.psa" For Input As #1
Input #1, mm
Close #1
For i = 1 To Len(mm)
pas(i - 1) = Mid(mm, i, 1) '将密文分成单个字符
pas(i - 1) = Chr(Asc(pas(i - 1)) - i) '单个字符解密
Next i
mm = ""
For i = 1 To 8
mm = mm + pas(i - 1) '合并得到明文
Next i
If Text3.Text = "" Then
MsgBox "您没有输入密码,请输入。", 48, "提示"
Exit Sub
End If
If Text3.Text <> mm Then '密码不对
If n = 3 Then '三次都不对
MsgBox "请尊重他人的隐私权!你没有隐私吗?", 48, "我会告你的哦!"
End
Else
MsgBox "您输入的密码不对,请重输。", 48, "提示"
Text3.SetFocus
Text3.Text = ""
n = n + 1
End If
Else
Load mainfrm
mainfrm.Show
Unload Me
End If
End If
Else
Load mainfrm
mainfrm.Show
Unload Me
End If
End If
End Sub
Private Sub CommandButton2_Click()
Unload Me
End Sub
Private Sub Form_Activate()
If Text3.Visible = True Then Text3.SetFocus
End Sub
Private Sub Form_Load()
n = 0
ret = GetSetting("yonghu", "start", "word")
If ret = "" Then
MsgBox "您没有安装此程序或程序出错,请重新安装。", 48, "提示"
Unload password
Exit Sub
End If
If ret = "first" Then '程序是否第一次运行
Label4.Visible = False
Text3.Visible = False
Label2.Visible = True
Label3.Visible = True
Text1.Visible = True
Text2.Visible = True
Label6.Visible = True
'创建“类别”存储文件
Open App.Path + "\lenbiezc.szl" For Output As #1
Open App.Path + "\lenbiesr.szl" For Output As #2
Print #1, "生活用品"
Print #1, "娱乐学习 "
Print #1, "餐饮食品"
Print #1, "服装工具"
Print #1, "礼上往来(支)"
Print #1, "成本投入"
Print #1, "其它支出"
Print #2, "工资收入"
Print #2, "投资收益"
Print #2, "礼上往来(收)"
Print #2, "其它收入"
Close #1
Close #2
Else
If ret = "nopass" Then
Load mainfrm
mainfrm.Show
Unload Me
Else
Label4.Visible = True
Text3.Visible = True
Label6.Visible = False
Label2.Visible = False
Label3.Visible = False
Text1.Visible = False
Text2.Visible = False
End If
End If
End Sub
Private Sub Text3_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Call CommandButton1_Click
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -