Oggetto unità ASP


L'oggetto Drive viene utilizzato per ottenere informazioni su un'unità disco locale o una condivisione di rete.


Altri esempi


Come ottenere la dimensione totale di un'unità specificata.


Come ottenere lo spazio disponibile di un'unità specificata.


Come ottenere lo spazio libero di un'unità specificata.


Come ottenere la lettera di unità di un'unità specificata.


Come ottenere il tipo di unità di un'unità specificata.


Come ottenere il file system di un'unità specificata.


Come verificare se un'unità specificata è pronta.


Come ottenere il percorso di un'unità specificata.


Come ottenere la cartella principale di un'unità specificata.


Come ottenere il numero di serie di un'unità specificata.



L'oggetto guida

L'oggetto Drive viene utilizzato per restituire informazioni su un'unità disco locale o una condivisione di rete. L'oggetto Drive può restituire informazioni sul tipo di file system di un'unità, spazio libero, numero di serie, nome del volume e altro.

Nota: non è possibile restituire informazioni sul contenuto di un'unità con l'oggetto Drive. A questo scopo dovrai usare l'oggetto Folder.

Per lavorare con le proprietà dell'oggetto Drive, dovrai creare un'istanza dell'oggetto Drive tramite l'oggetto FileSystemObject. Primo; creare un oggetto FileSystemObject e quindi creare un'istanza dell'oggetto Drive tramite il metodo GetDrive o la proprietà Drives dell'oggetto FileSystemObject.

Le proprietà dell'oggetto Drive sono descritte di seguito:

Proprietà

Property Description
AvailableSpace Returns the amount of available space to a user on a specified drive or network share
DriveLetter Returns one uppercase letter that identifies the local drive or a network share
DriveType Returns the type of a specified drive
FileSystem Returns the file system in use for a specified drive
FreeSpace Returns the amount of free space to a user on a specified drive or network share
IsReady Returns true if the specified drive is ready and false if not
Path Returns an uppercase letter followed by a colon that indicates the path name for a specified drive
RootFolder Returns a Folder object that represents the root folder of a specified drive
SerialNumber Returns the serial number of a specified drive
ShareName Returns the network share name for a specified drive
TotalSize Returns the total size of a specified drive or network share
VolumeName Sets or returns the volume name of a specified drive