📄 frmserial.frm
字号:
VERSION 5.00
Begin VB.Form frmSerial
BorderStyle = 3 'Fixed Dialog
ClientHeight = 5160
ClientLeft = 45
ClientTop = 45
ClientWidth = 5835
ControlBox = 0 'False
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 5160
ScaleWidth = 5835
ShowInTaskbar = 0 'False
StartUpPosition = 2 'CenterScreen
Begin VB.Frame Frame1
Height = 1215
Left = 240
TabIndex = 6
Top = 2040
Width = 5295
Begin VB.CommandButton Command1
Caption = "&Click Here to Generate Number"
Height = 375
Left = 720
TabIndex = 10
Top = 720
Width = 3615
End
Begin VB.Label Label2
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "1-800-XXXXXXX"
BeginProperty Font
Name = "MS Sans Serif"
Size = 13.5
Charset = 178
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FF0000&
Height = 360
Left = 1530
TabIndex = 7
Top = 240
Width = 2250
End
End
Begin VB.CommandButton cmdCheck
Caption = "&Ok"
Default = -1 'True
BeginProperty Font
Name = "MS Sans Serif"
Size = 9.75
Charset = 178
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 4080
TabIndex = 5
Top = 4680
Width = 1455
End
Begin VB.CommandButton cmdExit
Caption = "E&xit"
BeginProperty Font
Name = "MS Sans Serif"
Size = 9.75
Charset = 178
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 240
TabIndex = 1
Top = 4680
Width = 1455
End
Begin VB.TextBox txtSerial
Height = 405
IMEMode = 3 'DISABLE
Left = 2040
TabIndex = 0
Top = 4080
Width = 3375
End
Begin VB.Label Label3
Caption = "Enter your activation code that you have received by e-mail or phone here:"
BeginProperty Font
Name = "MS Sans Serif"
Size = 8.25
Charset = 178
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H000000FF&
Height = 375
Left = 600
TabIndex = 9
Top = 3480
Width = 4575
End
Begin VB.Label Label5
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "Activation Code:"
BeginProperty Font
Name = "MS Sans Serif"
Size = 8.25
Charset = 178
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 195
Left = 360
TabIndex = 8
Top = 4200
Width = 1425
End
Begin VB.Label Label1
BackStyle = 0 'Transparent
Caption = "Please call the number shown below and have your user code ready to receive your activation code."
BeginProperty Font
Name = "MS Sans Serif"
Size = 8.25
Charset = 178
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 795
Left = 600
TabIndex = 4
Top = 960
Width = 4665
End
Begin VB.Label Label4
Alignment = 2 'Center
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "User Code"
BeginProperty Font
Name = "MS Sans Serif"
Size = 8.25
Charset = 178
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 195
Left = 465
TabIndex = 3
Top = 360
Width = 915
End
Begin VB.Label lbl_HD_Serial_Number
Alignment = 2 'Center
BorderStyle = 1 'Fixed Single
BeginProperty Font
Name = "MS Sans Serif"
Size = 12
Charset = 178
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 1920
TabIndex = 2
Top = 360
Width = 3540
End
End
Attribute VB_Name = "frmSerial"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim Serial_Number, Activation_Code, Get_Serial_From_Registry
Private Sub cmdCheck_Click()
Dim Res, Msg
'Check Serial
If Activation_Code = Trim(txtSerial) Then
SaveSetting "App_Name", "Registration", "Code", txtSerial
Msg = "Thanks for your registration. Please keep your activation in save place."
Res = MsgBox(Msg, vbInformation, "Thanks")
frmMain.Text1 = Serial_Number
frmMain.Text2 = Activation_Code
Unload Me
frmMain.Show
Else
Res = MsgBox("Your activation code is not valid", vbInformation, "Wrong!")
txtSerial.SetFocus
End If
End Sub
Private Sub cmdExit_Click()
End
End Sub
Private Sub Command1_Click()
InputBox "Your Activation Code: ", "", Activation_Code
End Sub
Private Sub Form_Load()
Serial_Number = GetDriveInfo("C:\", GETDI_SERIAL) ' HD Serial Number
'simple calculation ( do your own )
Activation_Code = Left(Serial_Number, 4) 'Left 4 digits
Activation_Code = Activation_Code * 881999 'Multiply By 881999
Activation_Code = Left(Activation_Code, 6) 'Get the left 6 Numbers Only
'check if user registerd before
Get_Serial_From_Registry = GetSetting("App_Name", "Registration", "Code")
'If user already registerd then quit
If Activation_Code = Get_Serial_From_Registry Then
frmMain.Text1 = Serial_Number
frmMain.Text2 = Activation_Code
Unload Me
frmMain.Show
'else show the HD serial code
Else
lbl_HD_Serial_Number = Serial_Number
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -