ASP Drive 对象


Drive 对象用于获取有关本地磁盘驱动器或网络共享的信息。


更多示例

获取指定驱动器的总大小
如何获取指定驱动器的总大小。

获取指定驱动器的可用空间
如何获取指定驱动器的可用空间。

获取指定驱动器的可用空间
如何获取指定驱动器的可用空间。

获取指定驱动器的盘符
如何获取指定驱动器的盘符。

获取指定驱动器的驱动器类型
如何获取指定驱动器的驱动器类型。

获取指定驱动器的文件系统
如何获取指定驱动器的文件系统。

驱动准备好了吗?
如何检查指定的驱动器是否准备就绪。

获取指定驱动器的路径
如何获取指定驱动器的路径。

获取指定驱动器的根文件夹
如何获取指定驱动器的根文件夹。

获取指定驱动器的序列号
如何获取指定驱动器的序列号。



驱动对象

Drive 对象用于返回有关本地磁盘驱动器或网络共享的信息。 Drive 对象可以返回有关驱动器的文件系统类型、可用空间、序列号、卷名称等的信息。

笔记:您无法使用 Drive 对象返回有关驱动器内容的信息。为此,您必须使用文件夹对象。

要使用 Drive 对象的属性,您必须通过 FileSystemObject 对象创建 Drive 对象的实例。第一的;创建一个 FileSystemObject 对象,然后通过 GetDrive 方法或 FileSystemObject 对象的 Drives 属性实例化 Drive 对象。

Drive 对象的属性描述如下:

特性

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