📄 frmpsw.frm
字号:
VERSION 5.00
Begin VB.Form FrmPsw
BorderStyle = 1 'Fixed Single
Caption = "Password"
ClientHeight = 1905
ClientLeft = 45
ClientTop = 330
ClientWidth = 4530
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
Moveable = 0 'False
ScaleHeight = 1905
ScaleWidth = 4530
StartUpPosition = 1 'CenterOwner
Begin VB.CommandButton CmdCancel
Caption = "取消"
Height = 495
Left = 3360
TabIndex = 8
Top = 1200
Width = 975
End
Begin VB.CommandButton CmdOK
Caption = "确认"
Height = 495
Left = 3360
TabIndex = 7
Top = 600
Width = 975
End
Begin VB.TextBox TxtNew2
Appearance = 0 'Flat
Height = 285
IMEMode = 3 'DISABLE
Left = 1440
MaxLength = 10
PasswordChar = "*"
TabIndex = 3
Top = 1440
Width = 1575
End
Begin VB.TextBox TxtNew1
Appearance = 0 'Flat
Height = 285
IMEMode = 3 'DISABLE
Left = 1440
MaxLength = 10
PasswordChar = "*"
TabIndex = 2
Top = 1080
Width = 1575
End
Begin VB.TextBox Txtold
Appearance = 0 'Flat
Height = 285
IMEMode = 3 'DISABLE
Left = 1440
MaxLength = 10
PasswordChar = "*"
TabIndex = 1
Top = 600
Width = 1575
End
Begin VB.Label Label4
Caption = "再输一次"
Height = 255
Left = 240
TabIndex = 6
Top = 1440
Width = 975
End
Begin VB.Label Label3
Caption = "新密码"
Height = 255
Left = 240
TabIndex = 5
Top = 1080
Width = 1095
End
Begin VB.Label Label2
Caption = "旧密码"
Height = 255
Left = 240
TabIndex = 4
Top = 600
Width = 1095
End
Begin VB.Label Label1
Caption = "作为一般用户 你只能修改自己的密码"
Height = 255
Left = 360
TabIndex = 0
Top = 120
Width = 3855
End
End
Attribute VB_Name = "FrmPsw"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Const MxUser = 100
Dim user(MxUser), pws(MxUser), state(MxUser), Emplo(MxUser) As String
Private Sub CmdCancel_Click()
Me.Hide
If FrmMain.Pwin = "Frmmain" Then
FrmMain.Enabled = True
FrmMain.SetFocus
Else
Call FrmSys.ActiveAll
FrmSys.SetFocus
End If
End Sub
Private Sub cmdOK_Click()
Dim fil, i, Usercount As Integer
If TxtNew1.Text <> TxtNew2.Text Then
MsgBox "two times no yizhi"
TxtNew1.SetFocus
TxtNew2.Text = ""
SendKeys "{Home}+{End}"
Exit Sub
ElseIf Txtold.Text <> frmLogin.CurPsw Then
MsgBox "old password wrong"
Txtold.SetFocus
TxtNew1.Text = ""
TxtNew2.Text = ""
SendKeys "{Home}+{End}"
Exit Sub
Else
fil = FreeFile()
Open App.Path + "\user.ini" For Input As #fil
i = 0
Do While Not EOF(fil)
Input #fil, user(i), pws(i)
Input #fil, state(i), Emplo(i)
i = i + 1
Loop
Usercount = i
Close #fil
pws(frmLogin.CurId) = TxtNew1.Text
frmLogin.CurPsw = TxtNew1.Text
fil = FreeFile()
Open App.Path + "\user.ini" For Output As #fil
For i = 0 To Usercount - 1
Print #fil, user(i); ","; pws(i); ","; state(i); ","; Emplo(i)
Next i
Close #fil
Txtold.Text = ""
TxtNew1.Text = ""
TxtNew2.Text = ""
Me.Hide
If FrmMain.Pwin = "Frmmain" Then
FrmMain.Enabled = True
FrmMain.SetFocus
Else
Call FrmSys.ActiveAll
FrmSys.SetFocus
End If
End If
End Sub
Private Sub Form_LostFocus()
FrmPsw.SetFocus
End Sub
Private Sub Form_Unload(Cancel As Integer)
'FrmMain.Enabled = True
'FrmMain.SetFocus
Unload Me
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -