忍者ブログ
Slic3rの設定についてまとめてます。Slic3rの日本語版が見当たらなかったので、使い方をまとめました。 最近はC#のメモ帳代わりになってます。

C# | Environment.SpecialFolder

スポンサーリンク
System.Environment.SpecialFolder で取得できる特殊フォルダの一覧
(Windows7)

SpecialFolderの定義はこんな感じ
        public enum SpecialFolder
        {
            Desktop = 0,
            Programs = 2,
            Personal = 5,
            MyDocuments = 5,
            Favorites = 6,
            Startup = 7,
            Recent = 8,
            SendTo = 9,
            StartMenu = 11,
            MyMusic = 13,
            MyVideos = 14,
            DesktopDirectory = 16,
            MyComputer = 17,
            NetworkShortcuts = 19,
            Fonts = 20,
            Templates = 21,
            CommonStartMenu = 22,
            CommonPrograms = 23,
            CommonStartup = 24,
            CommonDesktopDirectory = 25,
            ApplicationData = 26,
            PrinterShortcuts = 27,
            LocalApplicationData = 28,
            InternetCache = 32,
            Cookies = 33,
            History = 34,
            CommonApplicationData = 35,
            Windows = 36,
            System = 37,
            ProgramFiles = 38,
            MyPictures = 39,
            UserProfile = 40,
            SystemX86 = 41,
            ProgramFilesX86 = 42,
            CommonProgramFiles = 43,
            CommonProgramFilesX86 = 44,
            CommonTemplates = 45,
            CommonDocuments = 46,
            CommonAdminTools = 47,
            AdminTools = 48,
            CommonMusic = 53,
            CommonPictures = 54,
            CommonVideos = 55,
            Resources = 56,
            LocalizedResources = 57,
            CommonOemLinks = 58,
            CDBurning = 59,
        }

下のコードで一覧を richTextBox に表示してみた。
 
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            richTextBox1.Text = string.Empty;

            Array array = Enum.GetValues(typeof(Environment.SpecialFolder));
            Environment.SpecialFolder[] SpecialFolderArray = array as Environment.SpecialFolder[];

            if (SpecialFolderArray != null)
            {
                foreach (Environment.SpecialFolder n in SpecialFolderArray)
                {
                    int num = (int)n;
                    string name = Enum.GetName(typeof(Environment.SpecialFolder), n);
                    string path = System.Environment.GetFolderPath(n);

                    string user = Environment.UserName;
                   
                    string line = name + ":" + path.Replace(user, "[ユーザ名]") + System.Environment.NewLine;
                    richTextBox1.Text = richTextBox1.Text + num.ToString() + "\t" + line;
                }
                richTextBox1.Text = richTextBox1.Text + System.Environment.NewLine;
            }
        }
    }

表示された結果
0	Desktop:C:\Users\[ユーザ名]\Desktop
2	Programs:C:\Users\[ユーザ名]\AppData\Roaming\Microsoft\Windows\Start Menu\Programs
5	MyDocuments:C:\Users\[ユーザ名]\Documents
5	MyDocuments:C:\Users\[ユーザ名]\Documents
6	Favorites:C:\Users\[ユーザ名]\Favorites
7	Startup:C:\Users\[ユーザ名]\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup
8	Recent:C:\Users\[ユーザ名]\AppData\Roaming\Microsoft\Windows\Recent
9	SendTo:C:\Users\[ユーザ名]\AppData\Roaming\Microsoft\Windows\SendTo
11	StartMenu:C:\Users\[ユーザ名]\AppData\Roaming\Microsoft\Windows\Start Menu
13	MyMusic:C:\Users\[ユーザ名]\Music
14	MyVideos:C:\Users\[ユーザ名]\Videos
16	DesktopDirectory:C:\Users\[ユーザ名]\Desktop
17	MyComputer:
19	NetworkShortcuts:C:\Users\[ユーザ名]\AppData\Roaming\Microsoft\Windows\Network Shortcuts
20	Fonts:C:\Windows\Fonts
21	Templates:C:\Users\[ユーザ名]\AppData\Roaming\Microsoft\Windows\Templates
22	CommonStartMenu:C:\ProgramData\Microsoft\Windows\Start Menu
23	CommonPrograms:C:\ProgramData\Microsoft\Windows\Start Menu\Programs
24	CommonStartup:C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Startup
25	CommonDesktopDirectory:C:\Users\Public\Desktop
26	ApplicationData:C:\Users\[ユーザ名]\AppData\Roaming
27	PrinterShortcuts:C:\Users\[ユーザ名]\AppData\Roaming\Microsoft\Windows\Printer Shortcuts
28	LocalApplicationData:C:\Users\[ユーザ名]\AppData\Local
32	InternetCache:C:\Users\[ユーザ名]\AppData\Local\Microsoft\Windows\Temporary Internet Files
33	Cookies:C:\Users\[ユーザ名]\AppData\Roaming\Microsoft\Windows\Cookies
34	History:C:\Users\[ユーザ名]\AppData\Local\Microsoft\Windows\History
35	CommonApplicationData:C:\ProgramData
36	Windows:C:\Windows
37	System:C:\Windows\system32
38	ProgramFiles:C:\Program Files
39	MyPictures:C:\Users\[ユーザ名]\Pictures
40	UserProfile:C:\Users\[ユーザ名]
41	SystemX86:C:\Windows\SysWOW64
42	ProgramFilesX86:C:\Program Files (x86)
43	CommonProgramFiles:C:\Program Files\Common Files
44	CommonProgramFilesX86:C:\Program Files (x86)\Common Files
45	CommonTemplates:C:\ProgramData\Microsoft\Windows\Templates
46	CommonDocuments:C:\Users\Public\Documents
47	CommonAdminTools:C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Administrative Tools
48	AdminTools:C:\Users\[ユーザ名]\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Administrative Tools
53	CommonMusic:C:\Users\Public\Music
54	CommonPictures:C:\Users\Public\Pictures
55	CommonVideos:C:\Users\Public\Videos
56	Resources:C:\Windows\resources
57	LocalizedResources:
58	CommonOemLinks:
59	CDBurning:C:\Users\[ユーザ名]\AppData\Local\Microsoft\Windows\Burn\Burn1


関連記事