Enumerate all special folders and display them : Environment : Development C# Examples


C# Examples » Development » Environment »

 

Enumerate all special folders and display them









    
using  System;

class  MainClass
{
        public  static  void  Main()  
        {
                foreach  (Environment.SpecialFolder  s  in  
                        Enum.GetValues(typeof(Environment.SpecialFolder)))  
                {
                        Console.WriteLine("{0}  folder  :  {1}",  
                                s,  Environment.GetFolderPath(s));
                }

        }
}
    
   
  
   



Output

Desktop folder : C:\Documents and Settings\Joe\Desktop
Programs folder : C:\Documents and Settings\Joe\Start Menu\Programs
Personal folder : C:\Documents and Settings\Joe\My Documents
Personal folder : C:\Documents and Settings\Joe\My Documents
Favorites folder : C:\Documents and Settings\Joe\Favorites
Startup folder : C:\Documents and Settings\Joe\Start Menu\Programs\Startup
Recent folder : C:\Documents and Settings\Joe\Recent
SendTo folder : C:\Documents and Settings\Joe\SendTo
StartMenu folder : C:\Documents and Settings\Joe\Start Menu
MyMusic folder : C:\Documents and Settings\Joe\My Documents\My Music
DesktopDirectory folder : C:\Documents and Settings\Joe\Desktop
MyComputer folder :
Templates folder : C:\Documents and Settings\Joe\Templates
ApplicationData folder : C:\Documents and Settings\Joe\Application Data
LocalApplicationData folder : C:\Documents and Settings\Joe\Local Settings\Application Data
InternetCache folder : C:\Documents and Settings\Joe\Local Settings\Temporary Internet Files
Cookies folder : C:\Documents and Settings\Joe\Cookies
History folder : C:\Documents and Settings\Joe\Local Settings\History
CommonApplicationData folder : C:\Documents and Settings\All Users\Application Data
System folder : C:\WINDOWS\system32
ProgramFiles folder : C:\Program Files
MyPictures folder : C:\Documents and Settings\Joe\My Documents\My Pictures
CommonProgramFiles folder : C:\Program Files\Common Files


HTML code for linking to this page:

Follow Navioo On Twitter

C# Examples

 Navioo Development
» Environment