Home  |  Delphi .net Home  |  System.IO.Path  |  GetDirectoryName Method
  
GetDirectoryName  
Method  
Gets the Directory (folder) name part of the specified Path string
Path Class
System.IO NameSpace
CF1.  Function GetDirectoryName ( PathString : String ) : String; Static;
CF : Methods with this mark are Compact Framework Compatible
Description
The PathString string is returned with the file name and extension, if present, removed. The directory is the name of a directory or folder that may contain files.
Microsoft MSDN Links
System.IO
System.IO.Path
 Author links

 Buy Website Traffic at
 Buywebsitetrafficexperts.com

 Buy Proxies at
 Buyproxies.io
 
 
 
A simple example
program Project1;
{$APPTYPE CONSOLE}

uses
  System.IO;

var
  PathString : String;

begin
  PathString := 'C:\Delphi\Testing\DelphiBasics.txt';

  Console.WriteLine('"{0}" has directory name "{1}"',
                    PathString,
                    System.IO.Path.GetDirectoryName(PathString));

  Console.Readline;
end.
   "C:\Delphi\Testing\DelphiBasics.txt" has directory name "C:\Delphi\Testing"
 
 
Delphi Programming Neil Moffatt 2002 - 2017. All rights reserved.  |  Contact the author