Home  |  Delphi .net Home  |  System.IO.Directory  |  GetCurrentDirectory Method
GetCurrentDirectory  
Method  
Get the Current Directory (folder)
Directory Class
System.IO NameSpace
NotCF1.  Function GetCurrentDirectory ( ) : String; Static;
CF : Methods with this mark are Compact Framework Compatible
Description
Gets the full path of the Current Directory (folder). The Current Directory is the default location for file activity.
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
 
 
Setting and getting the current directory
program Project1;
{$APPTYPE CONSOLE}

uses
  System.IO;

begin
  // Set the current directory
  System.IO.Directory.SetCurrentDirectory('C:\Program Files');

  // Display the current directory
  Console.WriteLine(System.IO.Directory.GetCurrentDirectory);

  Console.Readline;
end.
Show full unit code
  C:\Program Files
 
 
Delphi Programming © Neil Moffatt All rights reserved.  |  Contact the author