编程语言

img iwebsms

获得硬盘D盘序列号

发表于2004/9/28 19:37:00  928人阅读

'获得硬盘C盘序列号

Function GetDrvID() As Long

    Dim GetVal As Long

    Dim TempStr1 As New String(Chr(0), 255)

    Dim TempStr2 As New String(Chr(0), 255)

 

    Dim TempLon1 As Integer

 

    Dim TempLon2 As Integer

 

    Dim lres As Integer

 

    lres = GetVolumeInformation("D:", TempStr1, 256, GetVal, TempLon1, TempLon2, TempStr2, 256)

    Return GetVal

End Function

 

    Private Declare Function GetVolumeInformation Lib "kernel32" Alias "GetVolumeInformationA" (ByVal lpRootPathName As String, ByVal lpVolumeNameBuffer As String, ByVal nVolumeNameSize As Integer, ByRef lpVolumeSerialNumber As Long, ByVal lpMaximumComponentLength As Integer, ByVal lpFileSystemFlags As Integer, ByVal lpFileSystemNameBuffer As String, ByVal nFileSystemNameSize As Integer) As Integer

阅读全文
0 0

相关文章推荐

img
取 消
img