#Region "Microsoft.VisualBasic::9ef10319ded16d07938b6505bba5683c, ComputingServices\FileSystem\Objects\DriveInfo.vb"
' Author:
'
' asuka (amethyst.asuka@gcmodeller.org)
' xie (genetics@smrucc.org)
' xieguigang (xie.guigang@live.com)
'
' Copyright (c) 2018 GPL3 Licensed
'
'
' GNU GENERAL PUBLIC LICENSE (GPL3)
'
'
' This program is free software: you can redistribute it and/or modify
' it under the terms of the GNU General Public License as published by
' the Free Software Foundation, either version 3 of the License, or
' (at your option) any later version.
'
' This program is distributed in the hope that it will be useful,
' but WITHOUT ANY WARRANTY; without even the implied warranty of
' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
' GNU General Public License for more details.
'
' You should have received a copy of the GNU General Public License
' along with this program. If not, see .
' /********************************************************************************/
' Summaries:
' Class DriveInfo
'
' Properties: AvailableFreeSpace, DriveFormat, DriveType, IsReady, Name
' RootDirectory, TotalFreeSpace, TotalSize, VolumeLabel
'
' Constructor: (+2 Overloads) Sub New
'
'
' /********************************************************************************/
#End Region
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 BaseClass
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