Get hard disk D disk serial number

xiaoxiao2021-03-06  59

'Get hard disk C disk serial number

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

转载请注明原文地址:https://www.9cbs.com/read-112090.html

New Post(0)