Description |
If the current machine recognises the concept of logical drives (some devices do not), then a list is returned, where each drive has the following format :
"#:\"
Where # is a drive letter : A, B, C ... .
See the code for the drives on the author's machine.
|
| Notes | Static methods are not methods of an object - they are simply class functions or procedures available at any time.
|
|
Microsoft MSDN Links |
System.IO
System.IO.Directory
|
|
|
A simple example |
program Project1;
{$APPTYPE CONSOLE}
uses
System.IO;
var
Drives : Array of String;
i : Integer;
begin
// Get the logical drives on this machine
Drives := System.IO.Directory.GetLogicalDrives;
// Display them
for i := 0 to Length(Drives)-1 do
Console.WriteLine(Drives[i]);
Console.Readline;
end.
| Show full unit code | A:\
C:\
D:\
E:\
F:\
G:\
|
|
|
|