Developer Note (6)-shared software registration program compiling instance (2)
Source: Internet
Author: User
-To ensure the integrity of the article, you are not allowed to repost an article rather than all handwritten notes (mi6236)
Option Explicit
Private Declare Function GetVolumeInformation Lib "kernel32 "_
Alias "GetVolumeInformationA" (ByVal lpRootPathName As String ,_
ByVal lpVolumeNameBuffer As String, ByVal nVolumeNameSize As Long ,_
LpVolumeSerialNumber As Long, lpMaximumComponentLength As Long ,_
LpFileSystemFlags As Long, ByVal lpFileSystemNameBuffer As String ,_
ByVal nFileSystemNameSize As Long) As Long 'wait until the information of a disk partition
* Registration form *****************
'Use another ***. mdb to control whether the software has exceeded the trial period.
Private Sub Form_Load ()
'Obtain the original ID based on the serial number of drive C.
Dim Driver, VolName, Fsys As String
Dim volNumber, MCM, FSF As Long
Driver = "c :"
Dim res As Long
Dim localid As Long
Res = GetVolumeInformation (Driver, VolName, 127, volNumber, MCM, FSF, Fsys, 127)
'Encrypt the serial number of drive C and display it in the local code of the registration form.
Localid = ****** volNumber ****** 'encryption algorithm
Text1.Text = localid' displays the encrypted local code
End Sub
Private Sub cancel_Click ()
On Error GoTo error
'Check whether the system folder has the ***. mdb file. If not, it is the first time the system has been installed. Create this database file.
If Dir (sPath & "****. **") = "" Then
Dim ws As Workspace
Dim db As Database
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.