VB 写了一个程序 如何加入注册码 使一个注册码对应一台机器
我写了一个程序想在启动时需要输入注册码才能使用实现软件注册功能使一个注册码对应一台机器比如这个注册码必须在相应的硬盘序列号下才能生效我是新手希望把实例发到szzhouwe...
我写了一个程序 想在启动时需要输入注册码才能使用 实现软件注册功能 使一个注册码对应一台机器 比如这个注册码必须在相应的硬盘序列号下才能生效
我是新手 希望把实例发到szzhouwenqiang@gmail.com 展开
我是新手 希望把实例发到szzhouwenqiang@gmail.com 展开
展开全部
我这个好启是利用每一台机子都有唯一对应cpu序列号,来计算得到注册码,注册成功后,它会向注册表写散巧入注册信息,下次启动不再弹出注册窗口,否则将弹出错误窗口并自动结束程序。
代码程序已发给你
这是一个实例软件代码:
Private Sub Form_Load()
j = GetSetting("MyApp1", "Startup", "b")
If j = "1" Then
Form1.Show
Else
Call jiance
End If
End Sub
Private Sub jiance()
Dim cpuSet
Dim cpu
Set cpuSet = GetObject("winmgmts:{impersonationLevel=impersonate}").InstancesOf("Win32_Processor")
For Each cpu In cpuSet
a = (cpu.ProcessorId)
Next
For i = 1 To Len(a)
c = c & Asc(Mid(a, i, 1))
Next
a = InputBox("请输入注册码")
If a = c Then
Form1.Show
SaveSetting "MyApp1", "友掘如Startup", "b", "1"
Else
MsgBox "注册码错误"
End
End If
End Sub
这是计算注册码的代码:
Private Sub Command1_Click()
Dim cpuSet
Dim cpu
Set cpuSet = GetObject("winmgmts:{impersonationLevel=impersonate}").InstancesOf("Win32_Processor")
For Each cpu In cpuSet
a = (cpu.ProcessorId)
Next
Print "cpu序列号为:" & a; ""
For i = 1 To Len(a)
c = c & Asc(Mid(a, i, 1))
Next
Text1 = "与此对应的注册码为:" & c
End Sub
代码程序已发给你
这是一个实例软件代码:
Private Sub Form_Load()
j = GetSetting("MyApp1", "Startup", "b")
If j = "1" Then
Form1.Show
Else
Call jiance
End If
End Sub
Private Sub jiance()
Dim cpuSet
Dim cpu
Set cpuSet = GetObject("winmgmts:{impersonationLevel=impersonate}").InstancesOf("Win32_Processor")
For Each cpu In cpuSet
a = (cpu.ProcessorId)
Next
For i = 1 To Len(a)
c = c & Asc(Mid(a, i, 1))
Next
a = InputBox("请输入注册码")
If a = c Then
Form1.Show
SaveSetting "MyApp1", "友掘如Startup", "b", "1"
Else
MsgBox "注册码错误"
End
End If
End Sub
这是计算注册码的代码:
Private Sub Command1_Click()
Dim cpuSet
Dim cpu
Set cpuSet = GetObject("winmgmts:{impersonationLevel=impersonate}").InstancesOf("Win32_Processor")
For Each cpu In cpuSet
a = (cpu.ProcessorId)
Next
Print "cpu序列号为:" & a; ""
For i = 1 To Len(a)
c = c & Asc(Mid(a, i, 1))
Next
Text1 = "与此对应的注册码为:" & c
End Sub
展开全部
Give me a mial, i send the form to u.
Happyq6@163.com
Option Explicit
Public LoginSucceeded As Boolean
Private Sub cmdCancel_Click()
'ÉèÖÃÈ«¾Ö±äÁ¿Îª false
'侍激²»Ìáʾʧ°ÜµÄµÇ¼
LoginSucceeded = False
Me.Hide
End Sub
Private Sub cmdOK_Click()
'¼ì²éÕýÈ·µÄÃÜÂë
If txtPassword = "password" Then
'½«´úÂë·ÅÔÚÕâÀï´«µÝ
'³É¹¦µ½ calling º¯Êý
'ÉèÖ颤粗ÃÈ«¾Ö±äÁ¿Ê±×îÈÝÒ×µÄ
LoginSucceeded = True
Me.Hide
Else
MsgBox "ÎÞЧµÄÃÜÂ老洞袜룬ÇëÖØÊÔ!", , "µÇ¼"
txtPassword.SetFocus
SendKeys "+"
End If
End Sub
Happyq6@163.com
Option Explicit
Public LoginSucceeded As Boolean
Private Sub cmdCancel_Click()
'ÉèÖÃÈ«¾Ö±äÁ¿Îª false
'侍激²»Ìáʾʧ°ÜµÄµÇ¼
LoginSucceeded = False
Me.Hide
End Sub
Private Sub cmdOK_Click()
'¼ì²éÕýÈ·µÄÃÜÂë
If txtPassword = "password" Then
'½«´úÂë·ÅÔÚÕâÀï´«µÝ
'³É¹¦µ½ calling º¯Êý
'ÉèÖ颤粗ÃÈ«¾Ö±äÁ¿Ê±×îÈÝÒ×µÄ
LoginSucceeded = True
Me.Hide
Else
MsgBox "ÎÞЧµÄÃÜÂ老洞袜룬ÇëÖØÊÔ!", , "µÇ¼"
txtPassword.SetFocus
SendKeys "+"
End If
End Sub
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询