复制内容到剪贴板
代码:
Public Function WindowsCDKey() As String
Dim key1 As RegistryKey = Registry.LocalMachine.OpenSubKey("SOFTWARE\Microsoft\Windows NT\CurrentVersion")
Dim buffer1 As Byte() = DirectCast(key1.GetValue("DigitalProductId", New Byte(0 - 1) {}), Byte())
Dim text1 As String = ""
Dim num1 As Integer = 28
Do While True
Dim num2 As Long = 0
Dim num3 As Integer = 14
Do
num2 = (num2 * 256)
num2 = (num2 + Convert.ToInt64(buffer1((52 + num3))))
buffer1((52 + num3)) = Convert.ToByte(CLng((Convert.ToInt64(Math.Floor(CDbl((CSng(num2) / 24!)))) And Convert.ToInt64(255))))
num2 = (num2 Mod CLng(24))
num3 -= 1
Loop While (num3 >= 0)
num1 -= 1
text1 = ("BCDFGHJKMPQRTVWXY2346789".Chars(CInt(num2)).ToString & text1)
If ((((29 - num1) Mod 6) = 0) AndAlso (-1 <> num1)) Then
num1 -= 1
text1 = ("-" & text1)
End If
If (num1 < 0) Then
Return text1
End If
Loop
End Function
这点偶喜欢:huge: :huge: :huge:
替换cd-key的偶习惯于用M$给的代码