📄 form1.frm
字号:
Form2.Top = Me.Top
Form2.Label3.Visible = True
Form2.Label2.Caption = "本序列号生成器需要在您的程序读取用户的硬件编号,如硬盘序列号,然后您再根据用户的硬件编号生成25位数字序列号."
Form2.Label1.Caption = "产生唯一需求码"
End Sub
Private Sub Command15_Click()
Form2.Show
Form2.Left = Me.Left + Me.Width
Form2.Top = Me.Top
Form2.Label3.Visible = True
Form2.Label2.Caption = "This process splits the 25 digit request code into blocks of 5 digits. Each block is multiplied by a multiplication factor equal to the average of first digit, fourteenth digit, twenty fourth digit of the request and one more digit depending on the value of the first digit of the hard disk serial number. The new numbers are 6 digit numbers which are once again trimmed down to 5 digits."
Form2.Label1.Caption = "序列号分离和变形"
End Sub
Private Sub Command16_Click()
Form2.Show
Form2.Left = Me.Left + Me.Width
Form2.Top = Me.Top
Form2.Label3.Visible = True
Form2.Label2.Caption = "有选择性的反向基本上倒置, 形成的序列号为第三个和第五个块。 这时第一个数字就排在了最后, 第三个或第五个块然后是零, 它不会被倒置。 对那些想知道什么是反向, 其实就是数字互相颠倒。 即: 123 --> 321."
Form2.Label1.Caption = "序列号颠倒"
End Sub
Private Sub Command17_Click()
Form2.Show
Form2.Left = Me.Left + Me.Width
Form2.Top = Me.Top
Form2.Label3.Visible = True
Form2.Label2.Caption = "在字母替换时, 某些两位数字由二个字母替换,或字母和数字替换。 且把5个数字块进行不同的替换。 即: 27 --> M3 或53 --> XS 。 这些都是随机产生的, 但可以由开发商自己定义。"
Form2.Label1.Caption = "字母顺序替换"
End Sub
Private Sub Command18_Click()
Form2.Show
Form2.Left = Me.Left + Me.Width
Form2.Top = Me.Top
Form2.Label3.Visible = True
Form2.Label1.Caption = "位置交换"
Form2.Label2.Caption = "如标题所述,主要把5个字符块的位置进行交换. 每交换一次,硬件序列号的首字母都会有改变和移动."
End Sub
Private Sub Command19_Click()
Form2.Show
Form2.Left = Me.Left + Me.Width
Form2.Top = Me.Top
Form2.Label3.Visible = True
Form2.Label2.Caption = "这是最终生成的提供你硬件编码用户的软件注册码,你可以放在光盘或文本文件中发给用户..."
Form2.Label1.Caption = "最终序列号"
End Sub
Private Sub Command2_Click()
Text1.Text = SerNum("C") * -1
If Text1.Text < 0 Then
Text1.Text = Text1.Text * -1
End If
Text1.Text = Val(Invert(Text1.Text))
End Sub
Private Sub Command20_Click()
Form2.Show
Form2.Left = Me.Left + Me.Width
Form2.Top = Me.Top
Form2.Label3.Visible = False
Form2.Label2.Caption = "使用帮助,单击每一项目的提示按钮,将显示改功能的相应解释说明.左边的蓝色按钮是生成相应序列号的功能按钮."
Form2.Label1.Caption = "使用说明"
End Sub
Private Sub Command21_Click()
Form3.Label1.Caption = Text23.Text
Form3.Show
End Sub
Private Sub Command22_Click()
MsgBox "唯一序列号生成程序 Ver1.5" & vbCrLf & "http://www.mndsoft.com", vbInformation, "关于"
End Sub
Private Sub Command23_Click()
Dim ret
ret = MsgBox("每次的数字交换您将得到一个新的不同的序号,您仍然希望继续吗?", vbYesNo, "提示")
If ret = vbNo Then Exit Sub
If Text13.Text = "" Then
Command5_Click
End If
SwapDigits (Val(Mid(Text1.Text, 1, 1)))
Command12_Click
Command13_Click
End Sub
Private Sub SwapDigits(WhichDigit As Integer)
Dim SD As Integer
Dim Block(0 To 5) As String
Dim tmp_dig(0 To 5) As String
SD = Mid(WhichDigit, 1, 1)
If SD = 0 Then Exit Sub
If SD > 5 Then
SD = SD - 5
End If
Block(0) = Text13.Text
Block(1) = Text14.Text
Block(2) = Text15.Text
Block(3) = Text16.Text
Block(4) = Text17.Text
tmp_dig(0) = Mid(Block(0), SD, 1)
tmp_dig(1) = Mid(Block(1), SD, 1)
tmp_dig(2) = Mid(Block(2), SD, 1)
tmp_dig(3) = Mid(Block(3), SD, 1)
tmp_dig(4) = Mid(Block(4), SD, 1)
Block(1) = Mid(Block(1), 1, SD) & tmp_dig(0) & Mid(Block(1), SD + 1, 5 - SD)
Block(2) = Mid(Block(2), 1, SD) & tmp_dig(1) & Mid(Block(2), SD + 1, 5 - SD)
Block(3) = Mid(Block(3), 1, SD) & tmp_dig(2) & Mid(Block(3), SD + 1, 5 - SD)
Block(4) = Mid(Block(4), 1, SD) & tmp_dig(3) & Mid(Block(4), SD + 1, 5 - SD)
Block(0) = Mid(Block(0), 1, SD) & tmp_dig(4) & Mid(Block(0), SD + 1, 5 - SD)
Block(0) = Mid(Block(0), 1, SD - 1) & Mid(Block(0), SD + 1, 6 - SD)
Block(1) = Mid(Block(1), 1, SD - 1) & Mid(Block(1), SD + 1, 6 - SD)
Block(2) = Mid(Block(2), 1, SD - 1) & Mid(Block(2), SD + 1, 6 - SD)
Block(3) = Mid(Block(3), 1, SD - 1) & Mid(Block(3), SD + 1, 6 - SD)
Block(4) = Mid(Block(4), 1, SD - 1) & Mid(Block(4), SD + 1, 6 - SD)
Text13.Text = Block(0)
Text14.Text = Block(1)
Text15.Text = Block(2)
Text16.Text = Block(3)
Text17.Text = Block(4)
End Sub
Private Sub Command24_Click()
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Text6.Text = ""
Text7.Text = ""
Text8.Text = ""
Text9.Text = ""
Text10.Text = ""
Text11.Text = ""
Text12.Text = ""
Text13.Text = ""
Text14.Text = ""
Text15.Text = ""
Text16.Text = ""
Text17.Text = ""
Text18.Text = ""
Text19.Text = ""
Text20.Text = ""
Text21.Text = ""
Text22.Text = ""
Text23.Text = ""
End Sub
Private Sub Command3_Click()
Command2_Click
Text2.Text = Mid(Text1.Text & "5432463276523486583264856", 1, 25) 'replace "5432463276523486583264856" with your own 24 digit ProductID Code
End Sub
Private Function iSplit(orig As String, mFactor As Integer, Partition As Integer) As String
Dim tmp_key As String
Dim tmp_istring(0 To 5) As String
tmp_key = orig
tmp_istring(0) = Val(Mid(tmp_key, 1, 5)) * mFactor
tmp_istring(1) = Val(Mid(tmp_key, 6, 5)) * mFactor
tmp_istring(2) = Val(Mid(tmp_key, 11, 5)) * mFactor
tmp_istring(3) = Val(Mid(tmp_key, 16, 5)) * mFactor
tmp_istring(4) = Val(Mid(tmp_key, 21, 5)) * mFactor
iSplit = tmp_istring(Partition)
End Function
Private Sub Command4_Click()
Command1_Click
If Mid(Text3.Text, 5, 1) <> 0 Then
Text8.Text = Invert(Text3.Text)
Else
Text8.Text = Text3.Text
End If
Text10.Text = Invert(Text5.Text)
Text12.Text = Invert(Text7.Text)
Text9.Text = Text4.Text
Text11.Text = Text6.Text
End Sub
Private Sub Command5_Click()
Command4_Click
Text13.Text = Replace(Text8.Text, "27", "Z3")
Text13.Text = Replace(Text13.Text, "91", "8F")
Text13.Text = Replace(Text13.Text, "72", "1K")
Text13.Text = Replace(Text13.Text, "19", "PS")
Text13.Text = Replace(Text13.Text, "56", "O1")
Text13.Text = Replace(Text13.Text, "65", "M3")
Text13.Text = Replace(Text13.Text, "83", "L0")
Text13.Text = Replace(Text13.Text, "38", "E5")
Text13.Text = Replace(Text13.Text, "01", "XD")
Text13.Text = Replace(Text13.Text, "10", "PW")
Text14.Text = Replace(Text9.Text, "30", "C4")
Text14.Text = Replace(Text14.Text, "03", "UX")
Text14.Text = Replace(Text14.Text, "55", "I8")
Text14.Text = Replace(Text14.Text, "66", "PS")
Text14.Text = Replace(Text14.Text, "23", "MZ")
Text14.Text = Replace(Text14.Text, "32", "8Q")
Text14.Text = Replace(Text14.Text, "14", "0L")
Text14.Text = Replace(Text14.Text, "41", "XS")
Text14.Text = Replace(Text14.Text, "74", "9U")
Text14.Text = Replace(Text14.Text, "47", "NT")
Text15.Text = Replace(Text10.Text, "27", "Z3")
Text15.Text = Replace(Text15.Text, "91", "8F")
Text15.Text = Replace(Text15.Text, "72", "1K")
Text15.Text = Replace(Text15.Text, "19", "PS")
Text15.Text = Replace(Text15.Text, "56", "O1")
Text15.Text = Replace(Text15.Text, "32", "8Q")
Text15.Text = Replace(Text15.Text, "14", "0L")
Text15.Text = Replace(Text15.Text, "41", "XS")
Text15.Text = Replace(Text15.Text, "74", "9U")
Text15.Text = Replace(Text15.Text, "47", "NT")
Text16.Text = Replace(Text11.Text, "27", "Z3")
Text16.Text = Replace(Text16.Text, "91", "8F")
Text16.Text = Replace(Text16.Text, "72", "1K")
Text16.Text = Replace(Text16.Text, "19", "PS")
Text16.Text = Replace(Text16.Text, "56", "O1")
Text16.Text = Replace(Text16.Text, "65", "M3")
Text16.Text = Replace(Text16.Text, "83", "L0")
Text16.Text = Replace(Text16.Text, "38", "E5")
Text16.Text = Replace(Text16.Text, "01", "XD")
Text16.Text = Replace(Text16.Text, "10", "PW")
Text17.Text = Replace(Text12.Text, "30", "C4")
Text17.Text = Replace(Text17.Text, "03", "UX")
Text17.Text = Replace(Text17.Text, "55", "I8")
Text17.Text = Replace(Text17.Text, "66", "PS")
Text17.Text = Replace(Text17.Text, "23", "MZ")
Text17.Text = Replace(Text17.Text, "32", "8Q")
Text17.Text = Replace(Text17.Text, "14", "0L")
Text17.Text = Replace(Text17.Text, "41", "XS")
Text17.Text = Replace(Text17.Text, "74", "9U")
Text17.Text = Replace(Text17.Text, "47", "NT")
End Sub
Private Sub Command6_Click()
Dim i As Integer
Command5_Click
i = Val(Mid(Text1.Text, 1, 1))
Select Case i = Val(Mid(Text1.Text, 1, 1))
Case i = 1
Text18.Text = Text14.Text
Text19.Text = Text16.Text
Text20.Text = Text13.Text
Text21.Text = Text17.Text
Text22.Text = Text15.Text
Debug.Print "1"
Case i = 2
Text18.Text = Text16.Text
Text19.Text = Text13.Text
Text20.Text = Text15.Text
Text21.Text = Text14.Text
Text22.Text = Text17.Text
Debug.Print "2"
Case i = 3
Text18.Text = Text15.Text
Text19.Text = Text13.Text
Text20.Text = Text16.Text
Text21.Text = Text17.Text
Text22.Text = Text14.Text
Debug.Print "3"
Case i = 4
Text18.Text = Text13.Text
Text19.Text = Text14.Text
Text20.Text = Text16.Text
Text21.Text = Text17.Text
Text22.Text = Text15.Text
Debug.Print "4"
Case i = 5
Text18.Text = Text14.Text
Text19.Text = Text16.Text
Text20.Text = Text13.Text
Text21.Text = Text17.Text
Text22.Text = Text15.Text
Debug.Print "5"
Case i = 6
Text18.Text = Text14.Text
Text19.Text = Text16.Text
Text20.Text = Text13.Text
Text21.Text = Text17.Text
Text22.Text = Text15.Text
Debug.Print "6"
Case i = 7
Text18.Text = Text14.Text
Text19.Text = Text16.Text
Text20.Text = Text13.Text
Text21.Text = Text17.Text
Text22.Text = Text15.Text
Debug.Print "7"
Case i = 8
Text18.Text = Text16.Text
Text19.Text = Text13.Text
Text20.Text = Text15.Text
Text21.Text = Text14.Text
Text22.Text = Text17.Text
Debug.Print "8"
Case i = 9
Text18.Text = Text17.Text
Text19.Text = Text13.Text
Text20.Text = Text15.Text
Text21.Text = Text14.Text
Text22.Text = Text16.Text
Debug.Print "9"
End Select
Debug.Print "i = " & i
End Sub
Private Sub Command7_Click()
Command6_Click
Text23.Text = Text18.Text & "-" & Text19.Text & "-" & Text20.Text & "-" & Text21.Text & "-" & Text22.Text
End Sub
Private Sub Command8_Click()
Dim ret As String
Dim pID As String
If Text1.Text = "" Then
Command2_Click
End If
ret = InputBox("请输入一个24位的产品硬件编码... 仅只包含数字,如果数字编码过长或者过短,程序将自动调整.", "产品ID号")
pID = ret & "232323232323232323232323"
pID = Mid(pID, 1, 24)
Text2.Text = Mid(Text1.Text & pID, 1, 25)
End Sub
Private Sub Command9_Click()
Dim MFact As Integer
MFact = Int(Val(Val(Val(Mid(Text2.Text, 1, 1)) + Val(Mid(Text2.Text, 12, 1)) + Val(Mid(Text2.Text, 24, 1)) + Val(Mid(Text2.Text, Val(Mid(Text2.Text, 1, 1)), 1))) / 4))
Text3.Text = iSplit(Text2.Text, MFact, 0)
Text4.Text = iSplit(Text2.Text, MFact, 1)
Text5.Text = iSplit(Text2.Text, MFact, 2)
Text6.Text = iSplit(Text2.Text, MFact, 3)
Text7.Text = iSplit(Text2.Text, MFact, 4)
End Sub
Private Sub Form_Unload(Cancel As Integer)
End
End Sub
Private Sub mnuAbout_Click()
MsgBox "根据硬件编号生成注册号" & vbCrLf & "http://www.mndsoft.com", vbInformation, "关于"
End Sub
Private Sub mnuDS_Click()
Command23_Click
End Sub
Private Sub mnuExit_Click()
End
End Sub
Private Sub mnuLabel_Click()
Command21_Click
End Sub
Private Sub mnuLhelp_Click()
Command20_Click
End Sub
Private Sub mnuReg_Click()
If Text2.Text = "" Or Text23.Text = "" Then
Command7_Click
End If
Form5.Text1.Text = Text2.Text
Form5.Text1.Tag = Text23.Text
Form5.Show
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -