Ciao a tutti
Ho pensato che potesse servire a qualcuno
codice:
Imports System.Text
Imports System.Runtime.InteropServices
<DllImportAttribute("kernel32.dll")> _
Private Function GetVolumeInformation(ByVal PathName As String, ByVal VolumeNameBuffer As StringBuilder, ByVal VolumeNameSize As UInt32, ByRef VolumeSerialNumber As UInt32, ByRef MaximumComponentLength As UInt32, ByRef FileSystemFlags As UInt32, ByVal FileSystemNameBuffer As StringBuilder, ByVal FileSystemNameSize As UInt32) As Boolean
End Function
Function GetVolumeSerial(ByVal strDrive As String) As String
Dim VolSer As UInt32, MaxComL As UInt32, VolFlags As UInt32
Dim VolNameB As StringBuilder = New StringBuilder(256)
Dim FileSysNB As StringBuilder = New StringBuilder(256)
Dim renB As Boolean = GetVolumeInformation(strDrive, VolNameB, Convert.ToUInt32(VolNameB.Capacity), VolSer, MaxComL, VolFlags, FileSysNB, Convert.ToUInt32(FileSysNB.Capacity))
Return VolSer.ToString
End Function
Restituisce il seriale dell'HD
Ciao a tutti