Newsgroup: it.comp.lang.visual-basic
Titolo: getvolumeinformation

ciao
e' normale che la funzione getvolumeinformation con win98 mi ritorna
il codice nr. seriale uguale a 0? con pc nt/2000/xp non mi crea nessun
problema.
grazie
La matematica puo' definirsi come la materia nella quale 
non sappiamo mai di cosa stiamo parlando 
ne' se quel che stiamo dicendo e' vero. 
					 B. Russel.

 grazie
ho avuto anche io problemi con la getvolume ma non ho potuto mai investigare
(usavo la getvolume per generare un numero di registrazione, ma da alcune
macchine (W98) ricevev anche io uno 0 !)
provato con l'esempio di Allapi ? te lo allego !
Guarda questa nota ( sempre da allapi ) :
"If the function succeeds, the return value is nonzero.
If the function fails, the return value is zero. To get extended error
information, call GetLastError."
Esempio di allapi:
Private Declare Function GetVolumeInformation Lib "Kernel32" Alias
"GetVolumeInformationA" (ByVal lpRootPathName As String, ByVal
lpVolumeNameBuffer As String, ByVal nVolumeNameSize As Long,
lpVolumeSerialNumber As Long, lpMaximumComponentLength As Long,
lpFileSystemFlags As Long, ByVal lpFileSystemNameBuffer As String, ByVal
nFileSystemNameSize As Long) As Long
Private Sub Form_Load()
'KPD-Team 1998
'URL: 
http://www.allapi.net/
'E-Mail: KPD...@Allapi.net
Dim Serial As Long, VName As String, FSName As String
'Create buffers
VName = String$(255, Chr$(0))
FSName = String$(255, Chr$(0))
'Get the volume information
GetVolumeInformation "C:\", VName, 255, Serial, 0, 0, FSName, 255
'Strip the extra chr$(0)'s
VName = Left$(VName, InStr(1, VName, Chr$(0)) - 1)
FSName = Left$(FSName, InStr(1, FSName, Chr$(0)) - 1)
MsgBox "The Volume name of C:\ is '" + VName + "', the File system name of
C:\ is '" + FSName + "' and the serial number of C:\ is '" +
Trim(Str$(Serial)) + "'", vbInformation + vbOKOnly, App.Title
End Sub
-- 
<Gigio2K>
--- 
http://www.g2kweb.it/gigio2k
 ---
Nokia -> I.T.H.N. -> 
http://www.ithn.it/
VB -> I.C.L.VB -> 
http://www.it-lang-vb.net/

 il codice nr. seriale uguale a 0?
no.
http://groups.google.it/groups?q=getvolumeinformation+win98+group:it.comp.lang.visual-basic&hl=it&lr=&ie=UTF-8&oe=UTF-8&selm=pc8P5.34017%24BF.1199110%40news.infostrada.it&rnum=1
bye
-- 
Esistono 10 tipi di persone: chi conosce il binario e chi no.
Gestione Ottica - Gestionale per Ottici e Programmi Gratuiti su:
http://www.nicolaottomano.it

"MIKE"
questo a me' funge :
Private Declare Function GetVolumeInformation Lib "Kernel32" Alias "GetVolumeInformationA" (ByVal lpRootPathName As String, ByVal
lpVolumeNameBuffer As String, ByVal nVolumeNameSize As Long, lpVolumeSerialNumber As Long, lpMaximumComponentLength As Long,
lpFileSystemFlags As Long, ByVal lpFileSystemNameBuffer As String, ByVal nFileSystemNameSize As Long) As Long
Private Sub Form_Load()
    'KPD-Team 1998
    'URL: 
http://www.allapi.net/
    Dim Serial As Long, VName As String, FSName As String
    'Create buffers
    VName = String$(255, Chr$(0))
    FSName = String$(255, Chr$(0))
    'Get the volume information
    GetVolumeInformation "C:\", VName, 255, Serial, 0, 0, FSName, 255
    'Strip the extra chr$(0)'s
    VName = Left$(VName, InStr(1, VName, Chr$(0)) - 1)
    FSName = Left$(FSName, InStr(1, FSName, Chr$(0)) - 1)
    MsgBox "The Volume name of C:\ is '" + VName + "', the File system name of C:\ is '" + FSName + "' and the serial number of
C:\ is '" + Trim(Str$(Serial)) + "'", vbInformation + vbOKOnly, App.Title
End Sub
--
Fosco