What directories do the different Application SpecialFolders point to in WindowsXP and Windows Vista

后端 未结 3 592
离开以前
离开以前 2020-12-15 04:23

Namely I have:

  • Environment.SpecialFolder.ApplicationData
  • Environment.SpecialFolder.CommonApplicationData
  • Envi
3条回答
  •  遥遥无期
    2020-12-15 04:32

    It's easy to check. Use Environment.GetFolderPath(...); and use MessageBox or Console.Write and it will show you where it points too. You only have to make simple app that will display paths for you, and run it under Windows XP and Windows Vista.

    using System;
    
    namespace EnvironmentCheck
    {
        class Program
        {
            static void Main(string[] args)
        {
            Console.Write(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\n");
            Console.Write(Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData)+ "\n");
            Console.Write(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData)+ "\n");
        }
    }
    }
    

    My results on Win 7 x64

    C:\Users\myUsername\AppData\Roaming
    C:\ProgramData
    C:\Users\myUsername\AppData\Local

提交回复
热议问题