Abundant Technologies - IT Consulting Experts

 Source Code Library

 Code Details

 
Public Declare Function GetVolumeInformation& Lib "kernel32" _ Alias "GetVolumeInformationA" _ (ByVal lpRootPathName As String, ByVal pVolumeNameBuffer As String, _ ByVal nVolumeNameSize As Long, lpVolumeSerialNumber As Long, _ lpMaximumComponentLength As Long, lpFileSystemFlags As Long, _ ByVal lpFileSystemNameBuffer As String, _ ByVal nFileSystemNameSize As Long) Public Const MAX_FILENAME_LEN = 256 Public Function DriveSerial(ByVal sDrv As String) As Long 'Usage: 'Dim ds As Long 'ds = DriveSerial("C") Dim RetVal As Long Dim str As String * MAX_FILENAME_LEN Dim str2 As String * MAX_FILENAME_LEN Dim a As Long Dim b As Long Call GetVolumeInformation(sDrv & ":\", str, _ MAX_FILENAME_LEN, RetVal, _ a, b, str2, MAX_FILENAME_LEN) DriveSerial = RetVal End Function

Mail To: info@3pc.com