Click or drag to resize

DriveInfoGetFreeDriveLetter Method (Boolean)

Gets an available drive letter on the local system.

Namespace:  Alphaleonis.Win32.Filesystem
Assembly:  AlphaFS (in AlphaFS.dll) Version: 2.2
Syntax
public static char GetFreeDriveLetter(
	bool getLastAvailable
)

Parameters

getLastAvailable
Type: SystemBoolean
When get the last available drive letter. When gets the first available drive letter.

Return Value

Type: Char
A drive letter as Char. When no drive letters are available, an exception is thrown.
Exceptions
ExceptionCondition
ArgumentOutOfRangeExceptionNo drive letters available.
Remarks
The letters "A" and "B" are reserved for floppy drives and will never be returned by this function.
See Also