module1.bas
来自「根据硬盘序列号加密程序」· BAS 代码 · 共 49 行
BAS
49 行
Attribute VB_Name = "Module1"
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
Public Function getid() As Long
Dim VoluName, Fsys As String
Dim volNumber, MCM, FSF As Long
VoluName = Space(256)
volNumber = 0
MCM = 256
FSF = 256
Fsys = Space(256)
Dim res As Long
res = GetVolumeInformation("c:\", VoluName, 256, volNumber, MCM, FSF, Fsys, 256)
If volNumber < 0 Then
volNumber = volNumber + 2 ^ 32
End If
localid = Int(Abs(volNumber / 12)) + 1234
getid = localid
End Function
Public Function jsid(dd As String) As String
Dim s As Integer
st = ""
For i = 1 To Len(dd)
s = Mid(dd, i, 1)
s = Abs(s * s + i - i * i) + i
If s > 100 Then
s = Mid(s, 1, 2)
End If
st = st & s
Next i
jsid = st
End Function
Public Function getfileid() As Long
Dim s As Long
Open "c:\register_my.dll" For Random As 3
Get 3, 1, s
Close 3
getfileid = s
End Function
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?