home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Planet Source Code Jumbo …e CD Visual Basic 1 to 7
/
4_2005-2006.ISO
/
data
/
Zips
/
Steganogra1945511132005.psc
/
frmKeyNew.frm
< prev
next >
Wrap
Text File
|
2005-06-24
|
7KB
|
230 lines
VERSION 5.00
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
Begin VB.Form frmKeyNew
AutoRedraw = -1 'True
BorderStyle = 3 'Fixed Dialog
Caption = " Enter New Key"
ClientHeight = 2700
ClientLeft = 45
ClientTop = 330
ClientWidth = 4845
ControlBox = 0 'False
HelpContextID = 400
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 2700
ScaleWidth = 4845
ShowInTaskbar = 0 'False
StartUpPosition = 1 'CenterOwner
Begin MSComctlLib.ProgressBar ProgressBar1
Height = 195
Left = 2100
TabIndex = 7
Top = 825
Width = 2475
_ExtentX = 4366
_ExtentY = 344
_Version = 393216
Appearance = 1
End
Begin VB.CheckBox Check1
Caption = "&Hide typing"
Height = 225
Left = 240
TabIndex = 2
Top = 2280
Width = 1860
End
Begin VB.CommandButton cmdCancel
Cancel = -1 'True
Caption = "&Cancel"
Height = 375
Left = 3405
TabIndex = 4
Top = 2160
Width = 1170
End
Begin VB.CommandButton cmdOK
Caption = "&OK"
Height = 375
Left = 2160
TabIndex = 3
Top = 2160
Width = 1170
End
Begin VB.TextBox txtConfirm
BackColor = &H00FFFFFF&
ForeColor = &H00000000&
Height = 285
Left = 210
TabIndex = 1
Top = 1560
Width = 4365
End
Begin VB.TextBox txtCode
BackColor = &H00FFFFFF&
ForeColor = &H00000000&
Height = 285
Left = 210
TabIndex = 0
Top = 405
Width = 4365
End
Begin VB.Label lblQuality
Alignment = 1 'Right Justify
Caption = "Key Quality"
Height = 225
Left = 210
TabIndex = 8
Top = 840
Width = 1800
End
Begin VB.Label lblConfirm
Caption = "Confirm the Key"
Height = 225
Left = 210
TabIndex = 6
Top = 1350
Width = 4320
End
Begin VB.Label lblCode
Caption = "Enter the Key"
Height = 225
Left = 210
TabIndex = 5
Top = 195
Width = 3900
End
End
Attribute VB_Name = "frmKeyNew"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Form_Activate()
Me.cmdOK.Enabled = False
Me.txtCode.Text = ""
Me.txtConfirm.Text = ""
Me.txtCode.PasswordChar = "*"
Me.txtConfirm.PasswordChar = "*"
Me.Check1.Value = 1
Me.ProgressBar1.Value = 0
Me.txtCode.SetFocus
End Sub
Private Sub Check1_Click()
If Me.Check1.Value = 1 Then
Me.txtCode.PasswordChar = "*"
Me.txtConfirm.PasswordChar = "*"
Else
Me.txtCode.PasswordChar = ""
Me.txtConfirm.PasswordChar = ""
End If
End Sub
Private Sub cmdOK_Click()
If Me.txtCode.Text <> Me.txtConfirm.Text Or Me.txtCode.Text = "" Then
MsgBox "The key and the confirmation do not match." & vbCrLf & "Please enter the key again.", vbCritical
Me.txtCode.Text = ""
Me.txtConfirm.Text = ""
Me.txtCode.SetFocus
Exit Sub
End If
If IsValidKey(Me.txtCode.Text) = False Then
MsgBox "The key is too small or contains repetitions and did not meet the minimum security requirements. Please enter another key.", vbCritical
Me.txtCode.Text = ""
Me.txtConfirm.Text = ""
Me.txtCode.SetFocus
Exit Sub
End If
gstrActiveKey = Me.txtCode.Text
Me.txtCode.Text = ""
Me.txtConfirm.Text = ""
Me.Hide
End Sub
Private Sub cmdCancel_Click()
Me.txtCode.Text = ""
Me.txtConfirm.Text = ""
Me.Hide
End Sub
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Call RandomFeed(X, Y)
End Sub
Private Sub txtCode_Change()
Call KeyQuality
If Len(Me.txtCode.Text) > 0 Then
Me.cmdOK.Enabled = True
Else
Me.cmdOK.Enabled = False
End If
End Sub
Private Sub txtCode_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
KeyAscii = 0
If Me.txtCode <> "" Then Me.txtConfirm.SetFocus
End If
End Sub
Private Sub txtConfirm_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
KeyAscii = 0
If Me.txtConfirm <> "" And Me.cmdOK.Enabled = True Then cmdOK_Click
End If
End Sub
Private Sub KeyQuality()
Dim QC As Integer
Dim LN As Integer
Dim k As Integer
Dim Uc As Boolean
Dim Lc As Boolean
LN = Len(Me.txtCode.Text)
QC = LN * 3
'check ucases
For k = 1 To Len(Me.txtCode.Text)
If Asc(Mid(Me.txtCode.Text, k, 1)) > 64 And Asc(Mid(Me.txtCode.Text, k, 1)) < 91 Then Uc = True
Next k
'check ucases and lcases
For k = 1 To Len(Me.txtCode.Text)
If Asc(Mid(Me.txtCode.Text, k, 1)) > 96 And Asc(Mid(Me.txtCode.Text, k, 1)) < 123 Then Lc = True
Next k
If Uc = True And Lc = True Then QC = QC * 1.2
'check numbers
For k = 1 To Len(Me.txtCode.Text)
If Asc(Mid(Me.txtCode.Text, k, 1)) > 47 And Asc(Mid(Me.txtCode.Text, k, 1)) < 58 Then
If Uc = True Or Lc = True Then QC = QC * 1.4
Exit For
End If
Next k
'check signs
For k = 1 To Len(Me.txtCode.Text)
If Asc(Mid(Me.txtCode.Text, k, 1)) < 48 Or Asc(Mid(Me.txtCode.Text, k, 1)) > 122 Or (Asc(Mid(Me.txtCode.Text, k, 1)) > 57 And Asc(Mid(Me.txtCode.Text, k, 1)) < 65) Then QC = QC * 1.5: Exit For
Next k
If QC > 100 Then QC = 100
Me.ProgressBar1.Value = Int(QC)
End Sub
Private Sub txtConfirm_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Call RandomFeed(X, Y)
End Sub
Private Sub cmdCancel_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Call RandomFeed(X, Y)
End Sub
Private Sub cmdOK_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Call RandomFeed(X, Y)
End Sub
Private Sub txtCode_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Call RandomFeed(X, Y)
End Sub