- UID
- 901
注册时间2005-4-13
阅读权限40
最后登录1970-1-1
独步武林
TA的每日心情 | 奋斗 2024-10-30 21:11 |
---|
签到天数: 453 天 [LV.9]以坛为家II
|
楼主 |
发表于 2005-4-19 02:34:10
|
显示全部楼层
原注册机不完美,重发,就不编译了!
Option Explicit
Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long '函数声明,产生网络链接效果'
Const N As Double = 2612194154# 'N表示常数&H9BB2EB6A
Private Sub Image2_Click()
ShellExecute 0, "open", "http://ocn.e5v.com/cgi-bin/bbs/ccb/index.cgi?", vbNullString, vbNullString, 0 '到OCN破解组织
End Sub
Private Sub Image3_Click()
ShellExecute 0, "open", "http://luowei.mireene.com/bbs/index.php", vbNullString, vbNullString, 0 '到飘云论坛
End Sub
Private Sub Text2_Click()
Dim name As String
Dim code, codeyes As String
Dim lenj, d, e As Integer
Dim a, b, c As Double
name = Trim(Text1.Text)
lenj = Len(name)
If Len(name) = 0 Then
MsgBox "请输入注册名!", 48, "wofan[OCN]"
Text1.SetFocus
Exit Sub
End If
a = Asc(Mid$(name, lenj, 1))
b = a * lenj
code = CStr(b)
code = code & CStr(lenj)
a = CLng(code) * 2
b = a * 6
c = a * N
b = b * &H10000000
b = b * &H10
c = c - 1000
a = b + c
code = CStr(a) '转换成字串
lenj = Len(code) '取它的长度,以便确定浮点位数!
If StrComp(".", Mid$(code, 2, 1)) = 0 Then '看看是不是太大的数!
d = InStr(code, "+") '取得浮点位数的位置
e = CInt(Mid$(code, (d + 1))) '取得浮点位数
codeyes = Mid$(code, 1, 1) & Mid$(code, 3, (d - 4))
While Len(codeyes) < e + 1 '位数不够,就补零吧!
codeyes = codeyes & "0"
Wend
code = codeyes
lenj = Len(code)
End If
code = code & "E+" & (lenj - 1) '转成合法的浮点样式注册码
'因为VB6在数据太大时,会自作主张转换为浮点数,这个注机对于注册名长度超过9位,就会得到
'错误的注册码,它的形式就是多了一个E+……这真是莫名其妙!
'2005-4-19解决这个问题
'这么一个简单的问题,都要成为拦路虎!
'虽然有点罗嗦,不过问题还是解决了。VB真是有点麻烦。
Text2.Text = code
End Sub
Private Sub Text2_GotFocus()
With Text2
.SelStart = 0
.SelLength = Len(Trim(Text2.Text))
End With
End Sub |
|