-1199404169
-1473618034
-866455113
以上为三个机器码,恳求得到相应的硬盘序列号,谢谢!
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
'代码:
Function GetSerialNumber(sRoot) As Long
Dim lSerialNum As Long
Dim R As Long
Dim sTemp1 As String, sTemp2 As String
strlabel = String$(255, Chr$(0))
'注释: 磁盘卷标
strtype = String$(255, Chr$(0))
'注释: 文件系统类型 一般为 FAT
R = GetVolumeInformation(sRoot, strlabel, Len(strlabel), lSerialNum, 0, 0, strtype, Len(strtype))
GetSerialNumber = lSerialNum
'注释:在 strLabel 中为 磁盘卷标
'注释:在 strType 中为 文件系统类型
'用法: 当驱动器不存在时,函数返回 0。如果是个非根目录,也将返回 0:
End Function