home *** CD-ROM | disk | FTP | other *** search
/ Planet Source Code Jumbo …e CD Visual Basic 1 to 7 / 1_2002.ISO / Data / Zips / Cool_Regis69177452002.psc / keygen.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  2002-02-02  |  4.2 KB  |  144 lines

  1. VERSION 5.00
  2. Begin VB.Form keygen 
  3.    Caption         =   "Key Generator"
  4.    ClientHeight    =   1920
  5.    ClientLeft      =   60
  6.    ClientTop       =   330
  7.    ClientWidth     =   4440
  8.    Icon            =   "keygen.frx":0000
  9.    LinkTopic       =   "Form1"
  10.    ScaleHeight     =   1920
  11.    ScaleWidth      =   4440
  12.    StartUpPosition =   3  'Windows Default
  13.    Begin VB.TextBox Text4 
  14.       Height          =   285
  15.       Left            =   3480
  16.       Locked          =   -1  'True
  17.       MaxLength       =   5
  18.       TabIndex        =   8
  19.       Top             =   720
  20.       Width           =   615
  21.    End
  22.    Begin VB.TextBox Text3 
  23.       Height          =   285
  24.       Left            =   480
  25.       Locked          =   -1  'True
  26.       MaxLength       =   7
  27.       TabIndex        =   6
  28.       Top             =   720
  29.       Width           =   735
  30.    End
  31.    Begin VB.CommandButton Command2 
  32.       Caption         =   "Cancel"
  33.       Height          =   330
  34.       Left            =   2640
  35.       TabIndex        =   5
  36.       Top             =   1320
  37.       Width           =   1200
  38.    End
  39.    Begin VB.CommandButton Command1 
  40.       Caption         =   "Create"
  41.       Height          =   330
  42.       Left            =   360
  43.       TabIndex        =   4
  44.       Top             =   1320
  45.       Width           =   1200
  46.    End
  47.    Begin VB.TextBox Text2 
  48.       Height          =   315
  49.       Left            =   1440
  50.       Locked          =   -1  'True
  51.       MaxLength       =   17
  52.       TabIndex        =   3
  53.       Top             =   720
  54.       Width           =   1725
  55.    End
  56.    Begin VB.TextBox Text1 
  57.       Height          =   300
  58.       Left            =   1560
  59.       TabIndex        =   1
  60.       Top             =   240
  61.       Width           =   2385
  62.    End
  63.    Begin VB.Label Label4 
  64.       Alignment       =   2  'Center
  65.       Caption         =   "-"
  66.       BeginProperty Font 
  67.          Name            =   "MS Sans Serif"
  68.          Size            =   12
  69.          Charset         =   0
  70.          Weight          =   700
  71.          Underline       =   0   'False
  72.          Italic          =   0   'False
  73.          Strikethrough   =   0   'False
  74.       EndProperty
  75.       Height          =   255
  76.       Left            =   3240
  77.       TabIndex        =   9
  78.       Top             =   720
  79.       Width           =   255
  80.    End
  81.    Begin VB.Label Label3 
  82.       Alignment       =   2  'Center
  83.       Caption         =   "-"
  84.       BeginProperty Font 
  85.          Name            =   "MS Sans Serif"
  86.          Size            =   12
  87.          Charset         =   0
  88.          Weight          =   700
  89.          Underline       =   0   'False
  90.          Italic          =   0   'False
  91.          Strikethrough   =   0   'False
  92.       EndProperty
  93.       Height          =   255
  94.       Left            =   1200
  95.       TabIndex        =   7
  96.       Top             =   720
  97.       Width           =   255
  98.    End
  99.    Begin VB.Label Label2 
  100.       Caption         =   "Registration Code"
  101.       Height          =   270
  102.       Left            =   120
  103.       TabIndex        =   2
  104.       Top             =   480
  105.       Width           =   1395
  106.    End
  107.    Begin VB.Label Label1 
  108.       Caption         =   "Registration Name:"
  109.       Height          =   225
  110.       Left            =   120
  111.       TabIndex        =   0
  112.       Top             =   240
  113.       Width           =   1545
  114.    End
  115. Attribute VB_Name = "keygen"
  116. Attribute VB_GlobalNameSpace = False
  117. Attribute VB_Creatable = False
  118. Attribute VB_PredeclaredId = True
  119. Attribute VB_Exposed = False
  120. Private Sub Command1_Click()
  121. Dim Code1 As Single
  122. If Len(Text1.Text) < 4 Then
  123.     MsgBox "The Name must be more than 4 characters.", vbInformation + vbOKOnly, "Ooops"
  124.     Exit Sub
  125. End If
  126. For i = 1 To Len(Text1.Text) - 1
  127.     Code1 = Format(Asc(Right(Text1.Text, Len(Text1.Text) - i)) * 2 + (31 / i) + (i + 3 / 7), "#.#")
  128.     zip = zip & Code1
  129. Next i
  130. zip = Right(zip, 8)
  131. For i = 1 To Len(zip) - 1
  132.     Code1 = Format(Asc(Right(zip, Len(zip) - i)) * 2 + (1 / i) + (i + 1 / 7), "#00")
  133.     final = final & Code1
  134. Next i
  135. Text3.Text = "8546854"
  136. Text4.Text = "64381"
  137. final = Right(final, Len(final) - 4)
  138. final = final & Asc(Text1)
  139. Text2 = final
  140. End Sub
  141. Private Sub Command2_Click()
  142. Unload Me
  143. End Sub
  144.