io uso
codice:Private Declare Function GetVolumeSerialNumber Lib "kernel32" Alias "GetVolumeInformationA" (ByVal lpRootPathName As String, ByVal lpVolumeNameBuffer As Long, ByVal nVolumeNameSize As Long, lpVolumeSerialNumber As Long, ByVal lpMaximumComponentLength As Long, ByVal lpFileSystemFlags As Long, ByVal lpFileSystemNameBuffer As Long, ByVal nFileSystemNameSize As Long) As Long Private Function VolumeSerial(DriveLetter) As Long Dim Serial As Long Call GetVolumeSerialNumber(UCase(DriveLetter) & ":\", 0&, 0&, Serial, 0&, 0&, 0&, 0&) VolumeSerial = Serial End Function Esempio: MsgBox VolumeSerial("C")

Rispondi quotando