Description |
Returns the parent Directory (folder) to the specified PathString as a DirectoryInfo object.
|
| Notes | Static methods are not methods of an object - they are simply class functions or procedures available at any time.
|
| References | DirectoryInfo
|
|
Microsoft MSDN Links |
System.IO
System.IO.Directory
|
|
|
Getting the current folder name and its parent folder name |
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 parent folder
Console.WriteLine(System.IO.Directory.GetParent(Path));
Console.Readline;
end.
| Show full unit code | C:\Documents and Settings\Neil\My Documents\Borland Studio Projects
C:\Documents and Settings\Neil\My Documents
|
|
|
|