7,765
社区成员
发帖
与我相关
我的任务
分享
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
Private Sub Command1_Click()
Dim SN As Long
Dim str1 As String * 255
Dim str2 As String * 255
GetVolumeInformation "C:\", str1, Len(str1), SN, 0, 0, str2, Len(str2)
'SN 即为硬盘序列号
End Sub