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
|
Private m_lpRootPathName As String
Private m_lpVolumeNameBuffer As String
Private m_lpVolumeSerialNumber As Long
Private m_lpMaximumComponentLength As Long
Private m_lpFileSystemFlags As Long
Private m_lpFileSystemNameBuffer As String
Private m_nFileSystemNameSize As Long
Private Const MAX_PATH As Long = 260
Declare Function GetVolumeInformation Lib "Kernel32" _
Alias "GetVolumeInformationA" (ByVal lpRootPathName As String, _
ByVal lpVolumeNameBuffer As String, _
ByVal nVolumeNameSize As Long, _
ByVal lpVolumeSerialNumber As Long, _
ByVal lpMaximumComponentLength As Long, _
ByVal lpFileSystemFlags As Long, _
ByVal lpFileSystemNameBuffer As String, _
ByVal nFileSystemNameSize As Long) As Long
......
Private Function ObtenirNumeroSerieDisquePoste() As String
If GetVolumeInformation(m_lpRootPathName, m_lpVolumeNameBuffer, MAX_PATH, m_lpVolumeSerialNumber, _
m_lpMaximumComponentLength, m_lpFileSystemFlags, m_lpFileSystemNameBuffer, MAX_PATH) Then
Return m_lpVolumeSerialNumber.ToString()
Else
Return ""
End If
End Function |
Partager