Description |
Gets the root drive or folder for the specified PathString.
|
| 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
Path : String;
begin
// Get the current folder
Path := System.IO.Directory.GetCurrentDirectory;
Console.WriteLine(Path);
// Get the root of this folder
Console.WriteLine(System.IO.Directory.GetDirectoryRoot(Path));
Console.Readline;
end.
| Show full unit code | C:\Documents and Settings\Neil\My Documents\Borland Studio Projects
C:\
|
|
|
|