经常看到一些共享软件使用密码保护开发者的权益,听说很多使用读区硬盘序列号,进行一些适当‘加工’后,形成注册序列号,开发者根据用户的注册序列号给出一个注册号,软件完成注册。
1、能否详细解释一下这种方法的具体操作,能够提供源代码?
2、还有其他简便有效的注册方法吗?
1、能否详细解释一下这种方法的具体操作,能够提供源代码?
2、还有其他简便有效的注册方法吗?
解决方案 »
- vb项目下如何建立文件夹,并向其中读取文件
- 如何通过commondialog对image中的图片进行操作。在线等~~~~
- 用combobox控件来刷新 dategrid中的记录 这样的代码怎么写
- windows media player问题
- 怎样启动计算机
- 怎样得到系统的分辨率及其他有关显示方面的信息。
- 高分求助:编写一个客户端软件的问题
- 用crystalreport控件的打印问题...
- 我发现现在的很多问题都和timer有关
- 有没有可能用vb制作一个发送手机短信息的软件?
- 如何通过在WebBrowser控件中的网页内的链接来打开我需要的form 谢谢!
- 同意shawls辞去VB数据库版版主的请求
Dim Serial_Number, Activation_Code, Get_Serial_From_Registry
Private Sub cmdCheck_Click()
Dim Res, Msg
'Check Serial If Activation_Code = Trim(txtSerial) Then
SaveSetting "App_Name", "Registration", "Code", txtSerial
Msg = "感谢您的支持,请妥善保管此注册码!"
Res = MsgBox(Msg, vbInformation, "感谢")
frmMain.Text1 = Serial_Number
frmMain.Text2 = Activation_Code
Unload Me
frmMain.Show
Else
Res = MsgBox("注册码错误", vbInformation, "错误!")
txtSerial.SetFocus
End If
End Sub
Private Sub cmdExit_Click()
End
End SubPrivate Sub Command1_Click()
InputBox "您的注册码: ", "", Activation_Code
End SubPrivate Sub Form_Load()
Serial_Number = GetDriveInfo("C:\", GETDI_SERIAL) ' HD Serial Number
Text1.Text = Str(Serial_Number)
'simple calculation ( do your own )
Activation_Code = Left(Serial_Number, 4) 'Left 4 digits
Activation_Code = Activation_Code * 881999 'Multiply By 881999
Activation_Code = Left(Activation_Code, 6) 'Get the left 6 Numbers Only'check if user registerd before
Get_Serial_From_Registry = GetSetting("App_Name", "Registration", "Code")
'If user already registerd then quit
If Activation_Code = Get_Serial_From_Registry Then
frmMain.Text1 = Serial_Number
frmMain.Text2 = Activation_Code
Unload Me
frmMain.Show
'else show the HD serial code
Else
lbl_HD_Serial_Number = Serial_Number
End If
End Sub
____________
Public Declare Function GetVolumeInformation Lib "kernel32" Alias "GetVolumeInformationA" (ByVal lpRootPathName As String, ByVal lpVolumeNameBuffer As String, ByVal nVolumeNameSize As Long, lpVolumeSerial_Numberber As Long, lpMaximumComponentLength As Long, lpFileSystemFlags As Long, ByVal lpFileSystemNameBuffer As String, ByVal nFileSystemNameSize As Long) As Long
Public Const GETDI_SERIAL = 1
Public Const GETDI_LABEL = 2
Public Const GETDI_TYPE = 3
Function GetDriveInfo(strDrive As String, iType As Integer)
Dim Serial_Number As Long
Dim Drive_Label As String
Dim Fat_Type As String
Dim Return_Value As Long
Drive_Label = Space(256)
Fat_Type = Space(256)
Return_Value = GetVolumeInformation(strDrive, Drive_Label, Len(Drive_Label), Serial_Number, 0, 0, Fat_Type, Len(Fat_Type))
GetDriveInfo = CStr(Serial_Number)End Function
是用PB做的,是取硬盘的序列号,经过算法后加密。
不过我的程序每次取硬盘的号码都是数子,我的加密程序对字母不行,只可对数子。然后
经过配置INI文件,启动程序的时候进行读,咽喉做比较,判断。达到此程序只能在一个机器上运行,但是必须经过我的程序注册,取得加密的密码。