Home  |  Delphi .net Home  |  System.Environment  |  GetFolderPath Method
  
GetFolderPath  
Method  
Gets the path to one of a number of operating system folders
Environment Class
System NameSpace
NotCF1.  Function GetFolderPath ( FolderName : System.Environment.SpecialFolder ) : String; Static;
CF : Methods with this mark are Compact Framework Compatible
Description
Returns the path to one of a number of special system folders, as given by the FolderName enumeration value :
 
ApplicationData  The directory that serves as a common repository for application-specific data for the current roaming user. A roaming user works on more than one computer on a network. A roaming user's profile is kept on a server on the network and is loaded onto a system when the user logs on.
CommonApplicationData  The directory that serves as a common repository for application-specific data that is used by all users.
CommonProgramFiles  The directory for components that are shared across applications.
Cookies  The directory that serves as a common repository for Internet cookies.
Desktop  The logical Desktop rather than the physical file system location.
DesktopDirectory  The directory used to physically store file objects on the desktop. Do not confuse this directory with the desktop folder itself, which is a virtual folder.
Favorites  The directory that serves as a common repository for the user's favorite items.
History  The directory that serves as a common repository for Internet history items.
InternetCache  The directory that serves as a common repository for temporary Internet files.
LocalApplicationData  The directory that serves as a common repository for application-specific data that is used by the current, non-roaming user.
MyComputer  The "My Computer" folder.
MyMusic  The "My Music" folder.
MyPictures  The "My Pictures" folder.
Personal  The directory that serves as a common repository for documents.
ProgramFiles  The program files directory.
Programs  The directory that contains the user's program groups.
Recent  The directory that contains the user's most recently used documents.
SendTo  The directory that contains the Send To menu items.
StartMenu  The directory that contains the Start menu items.
Startup  The directory that corresponds to the user's Startup program group. The system starts these programs whenever a user logs on or starts Windows NT or later, or starts Windows 98.
System  The System directory.
Templates  The directory that serves as a common repository for document templates.
Microsoft MSDN Links
System
System.Environment
 Author links

 Buy Website Traffic at
 Buywebsitetrafficexperts.com

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

var
  path1, path2 : String;

begin
  path1 := Environment.GetFolderPath(Environment.SpecialFolder.System);
  path2 := Environment.GetFolderPath(Environment.SpecialFolder.Cookies);

  Console.WriteLine('System  path = ' + path1);
  Console.WriteLine('Cookies path = ' + path2);

  Console.ReadLine;
end.
   System  path = C:\WINDOWS\System32
   Cookies path = C:\Documents and Settings\Neil\Cookies
 
 
Delphi Programming Neil Moffatt 2002 - 2017. All rights reserved.  |  Contact the author