UtilDrivesFormatDrive Method
Formats a drive.
Namespace: DevCase.Core.IO.Devices.DrivesAssembly: DevCase.net48 (in DevCase.net48.dll) Version: 6.0.0.0 (6.0)
XMLNS for XAML: Not mapped to an xmlns.
Public Shared Function FormatDrive (
driveLetter As Char,
quickFormat As Boolean,
Optional fileSystem As DriveFileSystem = DriveFileSystem.NTFS,
Optional clusterSize As Integer = 0,
Optional volumeLabel As String = "",
Optional enableCompression As Boolean = false
) As DriveFormatResult
Dim driveLetter As Char
Dim quickFormat As Boolean
Dim fileSystem As DriveFileSystem
Dim clusterSize As Integer
Dim volumeLabel As String
Dim enableCompression As Boolean
Dim returnValue As DriveFormatResult
returnValue = UtilDrives.FormatDrive(driveLetter,
quickFormat, fileSystem, clusterSize,
volumeLabel, enableCompression)
static member FormatDrive :
driveLetter : char *
quickFormat : bool *
?fileSystem : DriveFileSystem *
?clusterSize : int *
?volumeLabel : string *
?enableCompression : bool
(* Defaults:
let _fileSystem = defaultArg fileSystem DriveFileSystem.NTFS
let _clusterSize = defaultArg clusterSize 0
let _volumeLabel = defaultArg volumeLabel ""
let _enableCompression = defaultArg enableCompression false
*)
-> DriveFormatResult
No code example is currently available or this language may not be supported.
- driveLetter Char
-
The drive letter to format.
- quickFormat Boolean
-
If set to , formats the volume with a quick format by removing files from the disk
without scanning the disk for bad sectors.
Use this option only if the disk has been previously formatted,
and you know that the disk is not damaged.
The default value is .
- fileSystem DriveFileSystem (Optional)
-
The filesystem format to use for this volume.
Default value is NTFS.
- clusterSize Int32 (Optional)
-
The disk allocation unit size—cluster size.
All of the filesystems organizes the hard disk based on cluster size,
which represents the smallest amount of disk space that can be allocated to hold a file.
The smaller the cluster size you use, the more efficiently your disk stores information.
If no cluster size is specified during format, Windows picks defaults based on the size of the volume.
These defaults have been selected to reduce the amount of space lost and to reduce fragmentation.
For general use, the default settings are strongly recommended.
- volumeLabel String (Optional)
-
The label to use for the new volume.
The volume label can contain up to 11 characters for FAT16 and FAT32 volumes,
and up to 32 characters for NTFS filesystem volumes.
- enableCompression Boolean (Optional)
-
Not implemented.
DriveFormatResult
If format success, the return value is
Success; otherwise;
a
DriveFormatResult value indicating the error.
This is a code example.
No code example is currently available or this language may not be supported.
Dim result As DriveFormatResult =
FormatDrive(driveLetter:="Z"c, quickFormat:=True,
fileSystem:=DriveFileSystem.Ntfs,
clusterSize:=4096, volumeLabel:="Drive Z")
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
ArgumentException
|
Volume-label for X filesystem can't be larger than Y characters.;volumeLabel
|