谁帮我用VB写个注册程序?
自己写了一个脚本,想做个注册的软件,我想利用读取硬盘ID,然后通过算发算出注册码,谁能帮忙写个这样的注册程序?
程序代码:
Option Explicit Private Declare Function GetVolumeInformation Lib _ "kernel32.dll" Alias "GetVolumeInformationA" (ByVal _ lpRootPathName As String, ByVal lpVolumeNameBuffer As _ String, ByVal nVolumeNameSize As Integer, _ lpVolumeSerialNumber As Long, lpMaximumComponentLength _ As Long, lpFileSystemFlags As Long, ByVal _ lpFileSystemNameBuffer As String, ByVal _ nFileSystemNameSize As Long) As Long Public Function GetSerialNumber(strDrive As String) As Long Dim SerialNum As Long, Res As Long, temp1 As String, temp2 As String temp1 = String$(255, Chr$(0)) temp2 = String$(255, Chr$(0)) Res = GetVolumeInformation(strDrive & ":/", temp1, _ Len(temp1), SerialNum, 0, 0, temp2, Len(temp2)) GetSerialNumber = SerialNum End Function Public Function CheckSerial(Hash) As Boolean CheckSerial = (GetSerial = Hash) End Function Public Function GetSerial(Optional DriveNumber As Long) As String If IsMissing(DriveNumber) Then DriveNumber = GetSerialNumber(Left(App.Path, 1)) GetSerial = UCase(Left(Right(MD5(GetID & PrivateKey, 32), 18), 8)) End Function Public Function GetID() As String GetID = UCase(Left(Right(MD5(GetSerialNumber(Left(App.Path, 1)) & PrivateKey, 32), 18), 8)) End Function