最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
开发手记(六)――共享软件注册程序编写实例(2)
时间:2022-07-02 12:10:33 编辑:袖梨 来源:一聚教程网
-为保证文章完整性,谢绝对某篇而非全部手记的转载(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 '等到某一磁盘分区的信息
'************注册窗体*****************
’运用另一个***.mdb来控制软件是否超出试用期
Private Sub Form_Load()
'根据C盘序列号得到原ID
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)
'将c盘序列号加密并显示在注册窗体的本机码中
localid = *****volNumber***** '加密算法
Text1.Text = localid'显示经加密后的本机码
End Sub
Private Sub cancel_Click()
On Error GoTo error
'检测系统文件夹是否有***.mdb文件,如果没有,则是系统第一次安装,建立此数据库文件
If Dir(sPath & "***.**") = "" Then
Dim ws As Workspace
Dim db As Database
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 '等到某一磁盘分区的信息
'************注册窗体*****************
’运用另一个***.mdb来控制软件是否超出试用期
Private Sub Form_Load()
'根据C盘序列号得到原ID
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)
'将c盘序列号加密并显示在注册窗体的本机码中
localid = *****volNumber***** '加密算法
Text1.Text = localid'显示经加密后的本机码
End Sub
Private Sub cancel_Click()
On Error GoTo error
'检测系统文件夹是否有***.mdb文件,如果没有,则是系统第一次安装,建立此数据库文件
If Dir(sPath & "***.**") = "" Then
Dim ws As Workspace
Dim db As Database
相关文章
- 《原神》5.2卡池抽取建议 11-14
- 《原神》5.2版本新怪物介绍 11-14
- 《原神》希诺宁增伤触发方法 11-14
- 《原神》循音觅奇活动入口 11-14
- 《原神》循音觅奇兑换码获取方法 11-14
- 《原神》花羽会活动飞行技巧介绍 11-14