Enumerate all special folders and display them : Environment « Development « C# / CSharp Tutorial

C# / CSharp Tutorial
1. Language Basics
2. Data Type
3. Operator
4. Statement
5. String
6. struct
7. Class
8. Operator Overload
9. delegate
10. Attribute
11. Data Structure
12. Assembly
13. Date Time
14. Development
15. File Directory Stream
16. Preprocessing Directives
17. Regular Expression
18. Generic
19. Reflection
20. Thread
21. I18N Internationalization
22. GUI Windows Forms
23. 2D
24. Design Patterns
25. Windows
26. XML
27. ADO.Net
28. Network
29. Directory Services
30. Security
31. unsafe
Microsoft Office Word 2007 Tutorial
Java
Java Tutorial
Java Source Code / Java Documentation
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
C# / C Sharp
ASP.Net
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
PHP
Python
SQL Server / T-SQL
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
C# / CSharp Tutorial » Development » Environment 
14. 2. 9. 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));
        }

    }
}

        
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
  
14. 2. Environment
14. 2. 1. Accessing Environment Settings: Environment.StackTrace
14. 2. 2. Accessing Environment Settings:
14. 2. 3. Accessing Environment Settings: Get OS version
14. 2. 4. Get the drives on this box
14. 2. 5. Accessing Environment Settings: Environment Variables
14. 2. 6. Accessing Environment Settings: Logical Drives
14. 2. 7. Access the command-line arguments directly through Environment.CommandLine
14. 2. 8. Environment.NewLine
14. 2. 9. Enumerate all special folders and display them
14. 2. 10. Retrieve a named environment variable
14. 2. 11. Expand Environment Variables
14. 2. 12. Retrieve all environment variables targeted at the process
14. 2. 13. Is AppDomain Finalizing For Unload(), Environment.HasShutdownStarted
14. 2. 14. WorkingSet change after loading the DLL
14. 2. 15. WorkingSet change After loading System.dll into 10 AppDomains
14. 2. 16. Unload the appdomains and check the working set
14. 2. 17. Accessing Environment Settings: Environment.CurrentDirectory and SystemDirectory
14. 2. 18. Accessing Environment Settings: Environment.MachineName and Environment.Version
w___w__w_.__j___a__v__a__2___s___.c__o_m__ | Contact Us
Copyright 2003 - 08 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.