VB获取硬盘物理序列号 源码
硬盘物理序列号,不是分区逻辑号,给源码加分,QQ:420079219如果获取到硬盘物理序列号后,怎样加密和解密?有源码加分...
硬盘物理序列号,不是分区逻辑号,给源码加分,QQ:420079219
如果获取到硬盘物理序列号后,怎样加密和解密?有源码加分 展开
如果获取到硬盘物理序列号后,怎样加密和解密?有源码加分 展开
2个回答
展开全部
Private Declare Function GetVolumeInformation _
Lib "kernel32" Alias "GetVolumeInformationA" _
(ByVal lpRootPathName As String, _
ByVal lpszVolumeNameBuffer As String, _
ByVal lVolumeNameSize As Long, _
lpVolumeSerialNumber As Long, _
lpMaximumComponentLength As Long, _
lpFileSystemFlags As Long, _
ByVal lpszFileSystemNameBuffer As String, _
ByVal nFileSystemNameSize As Long) As Long
Public Function GetVolumeSerialNumber(ByVal RootPath As String) As String
Dim lpszVolumeNameBuffer As String
Dim lpszFileSystemNameBuffer As String
Dim lVolumeNameSize As Long
Dim lpVolumeSerialNumber As Long
Dim lpMaximumComponentLength As Long
Dim lpFileSystemFlags As Long
Dim nFileSystemNameSize As Long
Dim lRetVal As Long
lpVolumeSerialNumber = 0
lpMaximumComponentLength = 0
lpFileSystemFlags = 0
lpszVolumeNameBuffer = Space$(255)
lpszFileSystemNameBuffer = Space(255)
lVolumeNameSize = Len(lpszVolumeNameBuffer)
nFileSystemNameSize = Len(lpszFileSystemNameBuffer)
lRetVal = GetVolumeInformation(RootPath, _
lpszVolumeNameBuffer, _
lVolumeNameSize, _
lpVolumeSerialNumber, _
lpMaximumComponentLength, _
lpFileSystemFlags, _
lpszFileSystemNameBuffer, _
nFileSystemNameSize)
GetVolumeSerialNumber = Hex$(lpVolumeSerialNumber)
End Function
Private Sub Command1_Click()
Dim sRetVal As String
sRetVal = GetVolumeSerialNumber("C:\")
MsgBox "VolumeSerialNumber is: " & sRetVal
End Sub
只需在窗体建一个COMMAND1。
Lib "kernel32" Alias "GetVolumeInformationA" _
(ByVal lpRootPathName As String, _
ByVal lpszVolumeNameBuffer As String, _
ByVal lVolumeNameSize As Long, _
lpVolumeSerialNumber As Long, _
lpMaximumComponentLength As Long, _
lpFileSystemFlags As Long, _
ByVal lpszFileSystemNameBuffer As String, _
ByVal nFileSystemNameSize As Long) As Long
Public Function GetVolumeSerialNumber(ByVal RootPath As String) As String
Dim lpszVolumeNameBuffer As String
Dim lpszFileSystemNameBuffer As String
Dim lVolumeNameSize As Long
Dim lpVolumeSerialNumber As Long
Dim lpMaximumComponentLength As Long
Dim lpFileSystemFlags As Long
Dim nFileSystemNameSize As Long
Dim lRetVal As Long
lpVolumeSerialNumber = 0
lpMaximumComponentLength = 0
lpFileSystemFlags = 0
lpszVolumeNameBuffer = Space$(255)
lpszFileSystemNameBuffer = Space(255)
lVolumeNameSize = Len(lpszVolumeNameBuffer)
nFileSystemNameSize = Len(lpszFileSystemNameBuffer)
lRetVal = GetVolumeInformation(RootPath, _
lpszVolumeNameBuffer, _
lVolumeNameSize, _
lpVolumeSerialNumber, _
lpMaximumComponentLength, _
lpFileSystemFlags, _
lpszFileSystemNameBuffer, _
nFileSystemNameSize)
GetVolumeSerialNumber = Hex$(lpVolumeSerialNumber)
End Function
Private Sub Command1_Click()
Dim sRetVal As String
sRetVal = GetVolumeSerialNumber("C:\")
MsgBox "VolumeSerialNumber is: " & sRetVal
End Sub
只需在窗体建一个COMMAND1。
AiPPT
2024-09-19 广告
2024-09-19 广告
随着AI技术的飞速发展,如今市面上涌现了许多实用易操作的AI生成工具1、简介:AiPPT: 这款AI工具智能理解用户输入的主题,提供“AI智能生成”和“导入本地大纲”的选项,生成的PPT内容丰富多样,可自由编辑和添加元素,图表类型包括柱状图...
点击进入详情页
本回答由AiPPT提供
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询