vb取 硬盘序列号(16制)
'取硬盘序列号
Private Declare Function hardisk 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 Form_Load()
On Error Resume Next '遇到错误,直接执行下一行。
Dim aa As Long
Dim VolName As String
Dim disnun As Long
Dim Maxlen As Long
Dim Sysflag As Long
Dim fsysName As String
aa = hardisk("c:\", VolName, 256, disnun, Maxlen, Sysflag, fsysName, 256)
Text1 = "c 硬盘序列号(16制): " & Hex(disnun)
End Sub
_____________________________________________________________________________ _
中磊UG二次开发教程 梅雷著 qq1821117007
学UG就上UG网 http://www.9sug.com/ |