📄 frmsecret.frm
字号:
VERSION 5.00
Begin VB.Form frmSecret
BorderStyle = 3 'Fixed Dialog
Caption = "注册窗口"
ClientHeight = 2055
ClientLeft = 45
ClientTop = 330
ClientWidth = 4665
ControlBox = 0 'False
Icon = "frmSecret.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 2055
ScaleWidth = 4665
ShowInTaskbar = 0 'False
StartUpPosition = 2 '屏幕中心
Begin VB.Frame Frame1
Caption = "注册信息"
Height = 1095
Left = 180
TabIndex = 2
Top = 240
Width = 4095
Begin VB.TextBox txtSN
BackColor = &H80000018&
Height = 285
Left = 1530
Locked = -1 'True
TabIndex = 4
TabStop = 0 'False
Top = 270
Width = 2130
End
Begin VB.TextBox txtSecret
Height = 285
Left = 1530
TabIndex = 3
Top = 645
Width = 2130
End
Begin VB.Label Label2
AutoSize = -1 'True
Caption = "序列号:"
Height = 180
Left = 720
TabIndex = 6
Top = 315
Width = 630
End
Begin VB.Label Label3
AutoSize = -1 'True
Caption = "注册码:"
Height = 180
Left = 705
TabIndex = 5
Top = 690
Width = 630
End
End
Begin VB.CommandButton cmdCancel
Caption = "取消[&C]"
Height = 390
Left = 2310
TabIndex = 1
Top = 1500
Width = 1125
End
Begin VB.CommandButton cmdOK
Caption = "确定[&O]"
Height = 390
Left = 750
TabIndex = 0
Top = 1500
Width = 1080
End
End
Attribute VB_Name = "frmSecret"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Public Register As Boolean
Private Sub cmdCancel_Click()
Register = False
Unload Me
End Sub
Private Sub cmdOK_Click()
If IsSecretOK Then
Register = True
Unload Me
End If
End Sub
Private Sub Form_Load()
On Error Resume Next
If GetSetting("Microsoft", "SoftWare", "SN", "123456") = "123456" Then
Randomize
SaveSetting "Microsoft", "SoftWare", "SN", CStr(CLng(Rnd() * 1000000))
End If
txtSN.Text = GetSetting("Microsoft", "SoftWare", "SN", "123456")
txtSecret.Text = GetSetting("Microsoft", "SoftWare", "Secret", "123456")
End Sub
Public Function IsSecretOK() As Boolean
Dim V1 As String, V2 As String
Dim I
V1 = txtSN.Text
V2 = txtSecret.Text
For I = 1 To Len(V1)
If ((Val(Mid(V1, I, 1)) * 3 + 6) Mod 10) <> Mid(V2, Len(V2) - I + 1, 1) Then
IsSecretOK = False
MsgBox "注册号错误!请与软件开发者联系!", vbInformation, "提示窗口"
Exit Function
End If
Next I
MsgBox "注册成功!", vbInformation, "提示窗口"
SaveSetting "Microsoft", "SoftWare", "Secret", Trim(txtSecret.Text)
IsSecretOK = True
End Function
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -