1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
|
Private root As String = '?
Private volume_name As String = '?
Private serial_number As Long
Private max_component_length As Long = '?
Private file_system_flags As Long = '?
Private file_system_name As String = '?
Private Declare Function GetVolumeInformation Lib "Kernel32" _
Alias "GetVolumeInformationA" ( _
ByVal rootPathName As String, _
ByVal vNameBuffer As String, _
ByVal vNameSize As Long, _
ByRef vSerialNumber As Long, _
ByVal maximumComponentLength As Long, _
ByVal fileSystemFlags As Long, _
ByVal fileSystemNameBuffer As String, _
ByVal fileSystemNameSize As Long) As Long
'...
Private Function ObtenirNumeroSerieDisquePoste() As String
If (GetVolumeInformation( _
root, _
volume_name, _
volume_name.Length, _
serial_number, _
max_component_length, _
file_system_flags, _
file_system_name, _
file_system_name.Length) = 0) Then
MessageBox.Show("Error getting volume information", _
"Error Getting Information", _
MessageBoxButtons.OK, _
MessageBoxIcon.Exclamation)
Return (String.Empty)
Else
Return serial_number.ToString()
End If
End Function |
Partager