April 2002
Intermediate to advanced
688 pages
19h 51m
English
Directory.GetLogicalDrives Method
System.IO.Directory
Directory.GetLogicalDrives( )
An array of strings, each element of which contains the name of the root directory on each logical drive on a system
Retrieves the names of all logical drives and root directories on a system
In the case of a mapped network drive, GetLogicalDrives returns the
letter to which the drive is mapped. For instance, if the folder
\\Pentium\C\AFolder is mapped to the Z drive,
then GetLogicalDrives will return Z:\ for this
logical drive.
Dim sDrives( ) As String
Dim i As Integer
sDrives = Directory.GetLogicalDrives( )
For i = 0 To UBound(sDrives)
Console.WriteLine(sDrives(i))
NextOn my system, this code displays the following:
A:\ C:\ D:\ E:\ F:\ G:\
Read now
Unlock full access