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 >
Text File  |  2005-06-24  |  7KB  |  230 lines

  1. VERSION 5.00
  2. Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
  3. Begin VB.Form frmKeyNew 
  4.    AutoRedraw      =   -1  'True
  5.    BorderStyle     =   3  'Fixed Dialog
  6.    Caption         =   " Enter New Key"
  7.    ClientHeight    =   2700
  8.    ClientLeft      =   45
  9.    ClientTop       =   330
  10.    ClientWidth     =   4845
  11.    ControlBox      =   0   'False
  12.    HelpContextID   =   400
  13.    LinkTopic       =   "Form1"
  14.    MaxButton       =   0   'False
  15.    MinButton       =   0   'False
  16.    ScaleHeight     =   2700
  17.    ScaleWidth      =   4845
  18.    ShowInTaskbar   =   0   'False
  19.    StartUpPosition =   1  'CenterOwner
  20.    Begin MSComctlLib.ProgressBar ProgressBar1 
  21.       Height          =   195
  22.       Left            =   2100
  23.       TabIndex        =   7
  24.       Top             =   825
  25.       Width           =   2475
  26.       _ExtentX        =   4366
  27.       _ExtentY        =   344
  28.       _Version        =   393216
  29.       Appearance      =   1
  30.    End
  31.    Begin VB.CheckBox Check1 
  32.       Caption         =   "&Hide typing"
  33.       Height          =   225
  34.       Left            =   240
  35.       TabIndex        =   2
  36.       Top             =   2280
  37.       Width           =   1860
  38.    End
  39.    Begin VB.CommandButton cmdCancel 
  40.       Cancel          =   -1  'True
  41.       Caption         =   "&Cancel"
  42.       Height          =   375
  43.       Left            =   3405
  44.       TabIndex        =   4
  45.       Top             =   2160
  46.       Width           =   1170
  47.    End
  48.    Begin VB.CommandButton cmdOK 
  49.       Caption         =   "&OK"
  50.       Height          =   375
  51.       Left            =   2160
  52.       TabIndex        =   3
  53.       Top             =   2160
  54.       Width           =   1170
  55.    End
  56.    Begin VB.TextBox txtConfirm 
  57.       BackColor       =   &H00FFFFFF&
  58.       ForeColor       =   &H00000000&
  59.       Height          =   285
  60.       Left            =   210
  61.       TabIndex        =   1
  62.       Top             =   1560
  63.       Width           =   4365
  64.    End
  65.    Begin VB.TextBox txtCode 
  66.       BackColor       =   &H00FFFFFF&
  67.       ForeColor       =   &H00000000&
  68.       Height          =   285
  69.       Left            =   210
  70.       TabIndex        =   0
  71.       Top             =   405
  72.       Width           =   4365
  73.    End
  74.    Begin VB.Label lblQuality 
  75.       Alignment       =   1  'Right Justify
  76.       Caption         =   "Key Quality"
  77.       Height          =   225
  78.       Left            =   210
  79.       TabIndex        =   8
  80.       Top             =   840
  81.       Width           =   1800
  82.    End
  83.    Begin VB.Label lblConfirm 
  84.       Caption         =   "Confirm the Key"
  85.       Height          =   225
  86.       Left            =   210
  87.       TabIndex        =   6
  88.       Top             =   1350
  89.       Width           =   4320
  90.    End
  91.    Begin VB.Label lblCode 
  92.       Caption         =   "Enter the Key"
  93.       Height          =   225
  94.       Left            =   210
  95.       TabIndex        =   5
  96.       Top             =   195
  97.       Width           =   3900
  98.    End
  99. End
  100. Attribute VB_Name = "frmKeyNew"
  101. Attribute VB_GlobalNameSpace = False
  102. Attribute VB_Creatable = False
  103. Attribute VB_PredeclaredId = True
  104. Attribute VB_Exposed = False
  105. Private Sub Form_Activate()
  106. Me.cmdOK.Enabled = False
  107. Me.txtCode.Text = ""
  108. Me.txtConfirm.Text = ""
  109. Me.txtCode.PasswordChar = "*"
  110. Me.txtConfirm.PasswordChar = "*"
  111. Me.Check1.Value = 1
  112. Me.ProgressBar1.Value = 0
  113. Me.txtCode.SetFocus
  114. End Sub
  115.  
  116. Private Sub Check1_Click()
  117. If Me.Check1.Value = 1 Then
  118.     Me.txtCode.PasswordChar = "*"
  119.     Me.txtConfirm.PasswordChar = "*"
  120.     Else
  121.     Me.txtCode.PasswordChar = ""
  122.     Me.txtConfirm.PasswordChar = ""
  123.     End If
  124. End Sub
  125.  
  126.  
  127. Private Sub cmdOK_Click()
  128. If Me.txtCode.Text <> Me.txtConfirm.Text Or Me.txtCode.Text = "" Then
  129.     MsgBox "The key and the confirmation do not match." & vbCrLf & "Please enter the key again.", vbCritical
  130.     Me.txtCode.Text = ""
  131.     Me.txtConfirm.Text = ""
  132.     Me.txtCode.SetFocus
  133.     Exit Sub
  134.     End If
  135. If IsValidKey(Me.txtCode.Text) = False Then
  136.     MsgBox "The key is too small or contains repetitions and did not meet the minimum security requirements. Please enter another key.", vbCritical
  137.     Me.txtCode.Text = ""
  138.     Me.txtConfirm.Text = ""
  139.     Me.txtCode.SetFocus
  140.     Exit Sub
  141.     End If
  142. gstrActiveKey = Me.txtCode.Text
  143. Me.txtCode.Text = ""
  144. Me.txtConfirm.Text = ""
  145. Me.Hide
  146. End Sub
  147.  
  148. Private Sub cmdCancel_Click()
  149. Me.txtCode.Text = ""
  150. Me.txtConfirm.Text = ""
  151. Me.Hide
  152. End Sub
  153.  
  154. Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
  155. Call RandomFeed(X, Y)
  156. End Sub
  157.  
  158. Private Sub txtCode_Change()
  159. Call KeyQuality
  160. If Len(Me.txtCode.Text) > 0 Then
  161.     Me.cmdOK.Enabled = True
  162.     Else
  163.     Me.cmdOK.Enabled = False
  164.     End If
  165. End Sub
  166.  
  167. Private Sub txtCode_KeyPress(KeyAscii As Integer)
  168. If KeyAscii = 13 Then
  169.     KeyAscii = 0
  170.     If Me.txtCode <> "" Then Me.txtConfirm.SetFocus
  171.     End If
  172. End Sub
  173.  
  174. Private Sub txtConfirm_KeyPress(KeyAscii As Integer)
  175. If KeyAscii = 13 Then
  176.     KeyAscii = 0
  177.     If Me.txtConfirm <> "" And Me.cmdOK.Enabled = True Then cmdOK_Click
  178.     End If
  179. End Sub
  180.  
  181. Private Sub KeyQuality()
  182. Dim QC As Integer
  183. Dim LN As Integer
  184. Dim k As Integer
  185. Dim Uc As Boolean
  186. Dim Lc As Boolean
  187. LN = Len(Me.txtCode.Text)
  188. QC = LN * 3
  189. 'check ucases
  190. For k = 1 To Len(Me.txtCode.Text)
  191.     If Asc(Mid(Me.txtCode.Text, k, 1)) > 64 And Asc(Mid(Me.txtCode.Text, k, 1)) < 91 Then Uc = True
  192. Next k
  193. 'check ucases and lcases
  194. For k = 1 To Len(Me.txtCode.Text)
  195.     If Asc(Mid(Me.txtCode.Text, k, 1)) > 96 And Asc(Mid(Me.txtCode.Text, k, 1)) < 123 Then Lc = True
  196. Next k
  197. If Uc = True And Lc = True Then QC = QC * 1.2
  198. 'check numbers
  199. For k = 1 To Len(Me.txtCode.Text)
  200.     If Asc(Mid(Me.txtCode.Text, k, 1)) > 47 And Asc(Mid(Me.txtCode.Text, k, 1)) < 58 Then
  201.         If Uc = True Or Lc = True Then QC = QC * 1.4
  202.         Exit For
  203.         End If
  204. Next k
  205. 'check signs
  206. For k = 1 To Len(Me.txtCode.Text)
  207.     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
  208. Next k
  209. If QC > 100 Then QC = 100
  210. Me.ProgressBar1.Value = Int(QC)
  211. End Sub
  212.  
  213. Private Sub txtConfirm_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
  214. Call RandomFeed(X, Y)
  215. End Sub
  216.  
  217. Private Sub cmdCancel_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
  218. Call RandomFeed(X, Y)
  219. End Sub
  220.  
  221. Private Sub cmdOK_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
  222. Call RandomFeed(X, Y)
  223. End Sub
  224.  
  225. Private Sub txtCode_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
  226. Call RandomFeed(X, Y)
  227. End Sub
  228.  
  229.  
  230.