|
|||||||
|
|
|
![]() |
|
|
Strumenti |
|
|
#1 |
|
Member
Iscritto dal: Jun 2001
Città: Roma
Messaggi: 142
|
Come leggere il codice driveC:, con VB6
Come è possibile leggere con il VB6, il numero di serie del disco Rigido C: o di altri dischi ?
Grazie, Visodont |
|
|
|
|
|
#2 |
|
Senior Member
Iscritto dal: Oct 2002
Messaggi: 487
|
Oggetto Drive, proprietà SerialNumber.
Aloha!
__________________
AcM Racing :: Nulla è impossibile per chi non deve farlo |
|
|
|
|
|
#3 |
|
Senior Member
Iscritto dal: Aug 2002
Città: Biella
Messaggi: 1882
|
Oppure se per caso nn ti va di utilizzare un controllo perchè ti serve solo per te e nn vuoi occupare la form inutilmente ecco qua il codice:
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: [email protected] 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 |
|
|
|
|
|
#4 |
|
Senior Member
Iscritto dal: Oct 2002
Messaggi: 487
|
Se non vogliamo occupare spazio sul form, io la vedo + semplice così :
Codice:
Dim fs, d, s
Set fs = CreateObject("Scripting.FileSystemObject")
Set d = fs.GetDrive("c")
s = "Numero Seriale :" & d.SerialNumber
MsgBox s
Aloha!
__________________
AcM Racing :: Nulla è impossibile per chi non deve farlo |
|
|
|
|
|
#5 |
|
Member
Iscritto dal: Jun 2001
Città: Roma
Messaggi: 142
|
Grazie, proverò !
Asta la vista, Visodont |
|
|
|
|
| Strumenti | |
|
|
Tutti gli orari sono GMT +1. Ora sono le: 05:26.


















