|
|
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.
|
C:\Documents and Settings\Thomas\My Documents\Borland Studio Projects
C:\Documents and Settings\Thomas\My Documents
|
|