vendredi, décembre 28, 2007

System.Environment.SpecialFolder

I was programing a small tool, where I need to access to user data, with the .net framework 2.0, those "special folders" are easy identified with the SpecialFolder enumerator, to test the different paths, I have created a console project, here is an illustration :

using System;
using System.Collections.Generic;
using System.Text;

namespace SpecialFolderTester
{
class Program
{
static void Main(string[] args)
{

Console.WriteLine("SpecialFolder.ApplicationData," + Environment.GetFolderPath(System.Environment.SpecialFolder.ApplicationData));
Console.ReadKey();
}
}
}


And here is all results :

- SpecialFolder.ApplicationData => C:\Documents and Settings\Administrator\Application Data


- SpecialFolder.CommonApplicationData => C:\Documents and Settings\All Users.WINDOWS\Application Data


- SpecialFolder.CommonProgramFiles => C:\Program Files\Common Files


- SpecialFolder.Cookies => C:\Documents and Settings\Administrator\Cookies


- SpecialFolder.Desktop => C:\Documents and Settings\Administrator\Desktop


- SpecialFolder.DesktopDirectory => C:\Documents and Settings\Administrator\Desktop


- SpecialFolder.Favorites => C:\Documents and Settings\Administrator\Favorites


- SpecialFolder.History => C:\Documents and Settings\Administrator\Local Settings\History


- SpecialFolder.InternetCache => C:\Documents and Settings\Administrator\Local Settings\Temporary Internet Files


- SpecialFolder.LocalApplicationData => C:\Documents and Settings\Administrator\Local Settings\Application Data


- SpecialFolder.MyComputer =>


- SpecialFolder.MyDocuments => C:\Documents and Settings\Administrator\My Documents


- SpecialFolder.MyMusic => C:\Documents and Settings\Administrator\My Documents\My Music


- SpecialFolder.MyPictures => C:\Documents and Settings\Administrator\My Documents\My Pictures


- SpecialFolder.Personal => C:\Documents and Settings\Administrator\My Documents


- SpecialFolder.ProgramFiles => C:\Program Files


- SpecialFolder.Programs => C:\Documents and Settings\Administrator\Start Menu\Programs


- SpecialFolder.Recent => C:\Documents and Settings\Administrator\Recent


- SpecialFolder.SendTo => C:\Documents and Settings\Administrator\SendTo


- SpecialFolder.StartMenu => C:\Documents and Settings\Administrator\Start Menu


- SpecialFolder.Startup => C:\Documents and Settings\All Users.WINDOWS\Start Menu\Programs\Startup


- SpecialFolder.System => C:\WINDOWS\system32


- SpecialFolder.Templates => C:\Documents and Settings\Administrator\Templates

Aucun commentaire: