Imports System.IO Imports System.Runtime.InteropServices Imports System.Runtime.Serialization Imports Microsoft.VisualBasic.Language Namespace FileSystem ''' ''' Provides access to information on a drive. ''' Public NotInheritable Class DriveInfo : Inherits ClassObject Sub New(info As System.IO.DriveInfo) Me.AvailableFreeSpace = info.AvailableFreeSpace Me.DriveFormat = info.DriveFormat Me.DriveType = info.DriveType Me.IsReady = info.IsReady Me.Name = info.Name Me.RootDirectory = info.RootDirectory Me.TotalFreeSpace = info.TotalFreeSpace Me.TotalSize = info.TotalSize Me.VolumeLabel = info.VolumeLabel End Sub Sub New() End Sub ' Exceptions: ' T:System.UnauthorizedAccessException: ' Access to the drive information is denied. ' ' T:System.IO.IOException: ' An I/O error occurred (for example, a disk error or a drive was not ready). ''' ''' Indicates the amount of available free space on a drive, in bytes. ''' ''' The amount of free space available on the drive, in bytes. Public Property AvailableFreeSpace As Long ' Exceptions: ' T:System.UnauthorizedAccessException: ' Access to the drive information is denied. ' ' T:System.IO.DriveNotFoundException: ' The drive does not exist or is not mapped. ' ' T:System.IO.IOException: ' An I/O error occurred (for example, a disk error or a drive was not ready). ''' ''' Gets the name of the file system, such as NTFS or FAT32. ''' ''' The name of the file system on the specified drive. Public Property DriveFormat As String ''' ''' Gets the drive type, such as CD-ROM, removable, network, or fixed. ''' ''' One of the enumeration values that specifies a drive type. Public Property DriveType As DriveType ''' ''' Gets a value that indicates whether a drive is ready. ''' ''' true if the drive is ready; false if the drive is not ready. Public Property IsReady As Boolean ''' ''' Gets the name of a drive, such as C:\. ''' ''' The name of the drive. Public Property Name As String ''' ''' Gets the root directory of a drive. ''' ''' An object that contains the root directory of the drive. Public Property RootDirectory As System.IO.DirectoryInfo ' Exceptions: ' T:System.UnauthorizedAccessException: ' Access to the drive information is denied. ' ' T:System.IO.DriveNotFoundException: ' The drive is not mapped or does not exist. ' ' T:System.IO.IOException: ' An I/O error occurred (for example, a disk error or a drive was not ready). ''' ''' Gets the total amount of free space available on a drive, in bytes. ''' ''' The total free space available on a drive, in bytes. Public Property TotalFreeSpace As Long ' Exceptions: ' T:System.UnauthorizedAccessException: ' Access to the drive information is denied. ' ' T:System.IO.DriveNotFoundException: ' The drive is not mapped or does not exist. ' ' T:System.IO.IOException: ' An I/O error occurred (for example, a disk error or a drive was not ready). ''' ''' Gets the total size of storage space on a drive, in bytes. ''' ''' The total size of the drive, in bytes. Public Property TotalSize As Long ' Exceptions: ' T:System.IO.IOException: ' An I/O error occurred (for example, a disk error or a drive was not ready). ' ' T:System.IO.DriveNotFoundException: ' The drive is not mapped or does not exist. ' ' T:System.Security.SecurityException: ' The caller does not have the required permission. ' ' T:System.UnauthorizedAccessException: ' The volume label is being set on a network or CD-ROM drive.-or-Access to the ' drive information is denied. ''' ''' Gets or sets the volume label of a drive. ''' ''' The volume label. Public Property VolumeLabel As String End Class End Namespace