Read soft hard disc serial number

zhaozj2021-02-11  183

Read soft hard disc serial number

Get the serial number to read information from the soft and hard disc, can be obtained by the following function: Public 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. Now explain this function: it is used to obtain serial numbers, volume labels, disk information (such as: whether compression, etc.) The following example: Prequest to call its custom function: Function GetitNum (strDrv As string) AS Longdim GetNum As Long Dim RS As Long Dim Temp1 AS String Dim Temp2 As StringTemp1 = String $ (255, ChR $ (0)) Temp2 = String $ (255, CHR $ (0)) RS = GetVolumeInformation (StrDrv, Temp1, Len (Temp1 ), Getnum, 0, 0, temp2, len (temp2)) msgbox "The" TEMP1MSGBOX "serial number is:" HEX (Serialnum) End function is used after use, then call GetitNum ("Display") Yes! This will be very smooth to control the mouse!

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

New Post(0)