?? form1.frm
字號:
Private Sub Command14_Click()
Form2.Show
Form2.Left = Me.Left + Me.Width
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 + -