home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Mother of All Windows Books
/
CD-MOM.iso
/
cd_mom
/
newsletr
/
vbz
/
vbz1-3
/
sssetpw.frm
< prev
next >
Wrap
Text File
|
1993-06-24
|
4KB
|
150 lines
VERSION 2.00
Begin Form frmSetPW
BorderStyle = 3 'Fixed Double
Caption = "Change Password"
Height = 3195
Left = 1635
LinkTopic = "Form2"
ScaleHeight = 2790
ScaleWidth = 4470
Top = 1920
Width = 4590
Begin CommandButton Command2
Cancel = -1 'True
Caption = "Cancel"
Height = 495
Left = 2760
TabIndex = 7
Top = 2160
Width = 1215
End
Begin CommandButton Command1
Caption = "Ok"
Default = -1 'True
Height = 495
Left = 480
TabIndex = 6
Top = 2160
Width = 1215
End
Begin TextBox txtConfirm
Enabled = 0 'False
Height = 375
Left = 2280
MaxLength = 20
PasswordChar = "*"
TabIndex = 5
Top = 1440
Width = 2055
End
Begin TextBox txtNew
Enabled = 0 'False
Height = 375
Left = 2280
MaxLength = 20
PasswordChar = "*"
TabIndex = 3
Top = 840
Width = 2055
End
Begin TextBox txtOld
Height = 375
Left = 2280
MaxLength = 20
PasswordChar = "*"
TabIndex = 1
Top = 240
Width = 2055
End
Begin Label Label3
Caption = "&Retype New Password:"
Enabled = 0 'False
Height = 255
Left = 120
TabIndex = 4
Top = 1440
Width = 2055
End
Begin Label Label2
Caption = "&NewPassword:"
Enabled = 0 'False
Height = 255
Left = 120
TabIndex = 2
Top = 840
Width = 1455
End
Begin Label Label1
Caption = "&Old Password:"
Height = 255
Left = 120
TabIndex = 0
Top = 240
Width = 1455
End
End
Sub Command2_Click ()
Unload Me
End Sub
Sub Command1_Click ()
Title$ = "Change Password"
Text$ = txtOld.Text
EncryptString Text$
If Text$ = IniPassword$ Then
NewPW$ = txtNew.Text
RePW$ = txtConfirm.Text
If NewPW$ = RePW$ Then
EncryptString NewPW$
SetIniString "control.ini", "ScreenSaver", "Password", NewPW$
Unload Me
Else
Mess$ = "The values for new Password and Retype New"
Mess$ = Mess$ + Chr(13) + "Password do not match."
Mess$ = Mess$ + Chr(13) + Chr(13) + "Try again."
MsgBox Mess$, 16, Title$
txtNew = ""
txtConfirm = ""
txtNew.SetFocus
End If
Else
Mess$ = "The value for Old Password is not correct" + Chr$(13) + Chr$(13)
Mess$ = Mess$ + "Check your screen saver password and then"
Mess$ = Mess$ + Chr$(13) + "try again."
MsgBox Mess$, 16, Title$
txtOld = ""
txtNew = ""
txtConfirm = ""
txtOld.SetFocus
End If
End Sub
Sub Form_Load ()
IniPassword$ = GetIniString$("control.ini", "ScreenSaver", "Password", "")
If Len(IniPassword$) = 0 Then
Label1.Enabled = False
txtOld.Enabled = False
Label2.Enabled = True
Label3.Enabled = True
txtNew.Enabled = True
txtConfirm.Enabled = True
End If
End Sub
Sub txtOld_Change ()
If Len(txtOld.Text) Then
Label2.Enabled = True
Label3.Enabled = True
txtNew.Enabled = True
txtConfirm.Enabled = True
Else
Label2.Enabled = False
Label3.Enabled = False
txtNew.Enabled = False
txtConfirm.Enabled = False
End If
End Sub