Environment.SpecialFolder 枚举

定义

指定用于检索系统特殊文件夹的目录路径的枚举常数。Specifies enumerated constants used to retrieve directory paths to system special folders.

public: enum class Environment::SpecialFolder
[System.Runtime.InteropServices.ComVisible(true)]
public enum Environment.SpecialFolder
type Environment.SpecialFolder = 
Public Enum Environment.SpecialFolder
继承
Environment.SpecialFolder
属性

字段

AdminTools 48

用于存储各个用户的管理工具的文件系统目录。The file system directory that is used to store administrative tools for an individual user. Microsoft Management Console (MMC) 会将自定义的控制台保存在此目录中,并且此目录将随用户一起漫游。The Microsoft Management Console (MMC) will save customized consoles to this directory, and it will roam with the user. 已添加到 .NET Framework 4 中。Added in the .NET Framework 4.

ApplicationData 26

用作当前漫游用户的应用程序特定数据的公共储存库的目录。The directory that serves as a common repository for application-specific data for the current roaming user. 漫游用户在网络上的多台计算机上工作。A roaming user works on more than one computer on a network. 漫游用户的配置文件保留在网络服务器上,并在用户登录时加载到系统中。A roaming user's profile is kept on a server on the network and is loaded onto a system when the user logs on.

CDBurning 59

充当等待写入 CD 的文件的临时区域的文件系统目录。The file system directory that acts as a staging area for files waiting to be written to a CD. 已添加到 .NET Framework 4 中。Added in the .NET Framework 4.

CommonAdminTools 47

包含计算机所有用户的管理工具的文件系统目录。The file system directory that contains administrative tools for all users of the computer. 已添加到 .NET Framework 4 中。Added in the .NET Framework 4.

CommonApplicationData 35

用作所有用户使用的应用程序特定数据的公共储存库的目录。The directory that serves as a common repository for application-specific data that is used by all users.

CommonDesktopDirectory 25

包含在所有用户桌面上出现的文件和文件夹的文件系统目录。The file system directory that contains files and folders that appear on the desktop for all users. 此特殊文件夹仅对 Windows NT 系统有效。This special folder is valid only for Windows NT systems. 已添加到 .NET Framework 4 中。Added in the .NET Framework 4.

CommonDocuments 46

包含所有用户共有的文档的文件系统目录。The file system directory that contains documents that are common to all users. 此特殊文件夹仅对装有 Shfolder.dll 的 Windows NT 系统、Windows 95 和 Windows 98 系统有效。This special folder is valid for Windows NT systems, Windows 95, and Windows 98 systems with Shfolder.dll installed. 已添加到 .NET Framework 4 中。Added in the .NET Framework 4.

CommonMusic 53

充当所有用户共有的音乐文件的存储库的文件系统目录。The file system directory that serves as a repository for music files common to all users. 已添加到 .NET Framework 4 中。Added in the .NET Framework 4.

58

为了实现向后兼容,Windows Vista 中可以识别此值,但该特殊文件夹本身已不再使用。This value is recognized in Windows Vista for backward compatibility, but the special folder itself is no longer used. 已添加到 .NET Framework 4 中。Added in the .NET Framework 4.

CommonPictures 54

充当所有用户共有的图像文件的存储库的文件系统目录。The file system directory that serves as a repository for image files common to all users. 已添加到 .NET Framework 4 中。Added in the .NET Framework 4.

CommonProgramFiles 43

用于应用程序间共享的组件的目录。The directory for components that are shared across applications.

若要在非 x86 系统上获取 x86 常规程序文件目录,请使用 ProgramFilesX86 成员。To get the x86 common program files directory on a non-x86 system, use the ProgramFilesX86 member.

CommonProgramFilesX86 44

“Program Files”文件夹。The Program Files folder. 已添加到 .NET Framework 4 中。Added in the .NET Framework 4.

CommonPrograms 23

跨应用程序共享的组件的文件夹。A folder for components that are shared across applications. 此特殊文件夹仅对 Windows NT、Windows 2000 和 Windows XP 系统有效。This special folder is valid only for Windows NT, Windows 2000, and Windows XP systems. 已添加到 .NET Framework 4 中。Added in the .NET Framework 4.

CommonStartMenu 22

文件系统目录,包含所有用户的“开始”菜单上都出现的程序和文件夹。The file system directory that contains the programs and folders that appear on the Start menu for all users. 此特殊文件夹仅对 Windows NT 系统有效。This special folder is valid only for Windows NT systems. 已添加到 .NET Framework 4 中。Added in the .NET Framework 4.

CommonStartup 24

文件系统目录,包含所有用户的“启动”文件夹中都出现的程序。The file system directory that contains the programs that appear in the Startup folder for all users. 此特殊文件夹仅对 Windows NT 系统有效。This special folder is valid only for Windows NT systems. 已添加到 .NET Framework 4 中。Added in the .NET Framework 4.

CommonTemplates 45

包含所有用户都可以使用的模板的文件系统目录。The file system directory that contains the templates that are available to all users. 此特殊文件夹仅对 Windows NT 系统有效。This special folder is valid only for Windows NT systems. 已添加到 .NET Framework 4 中。Added in the .NET Framework 4.

CommonVideos 55

充当所有用户共有的视频文件的存储库的文件系统目录。The file system directory that serves as a repository for video files common to all users. 已添加到 .NET Framework 4 中。Added in the .NET Framework 4.

Cookies 33

用作 Internet Cookie 的公共储存库的目录。The directory that serves as a common repository for Internet cookies.

Desktop 0

逻辑桌面,而不是物理文件系统位置。The logical Desktop rather than the physical file system location.

DesktopDirectory 16

用于物理上存储桌面上的文件对象的目录。The directory used to physically store file objects on the desktop. 不要混淆此目录与桌面文件夹本身,后者是一个虚拟文件夹。Do not confuse this directory with the desktop folder itself, which is a virtual folder.

Favorites 6

用作用户收藏夹项的公共储存库的目录。The directory that serves as a common repository for the user's favorite items.

Fonts 20

包含字体的虚拟文件夹。A virtual folder that contains fonts. 已添加到 .NET Framework 4 中。Added in the .NET Framework 4.

History 34

用作 Internet 历史记录项的公共储存库的目录。The directory that serves as a common repository for Internet history items.

InternetCache 32

用作 Internet 临时文件的公共储存库的目录。The directory that serves as a common repository for temporary Internet files.

LocalApplicationData 28

用作当前非漫游用户使用的应用程序特定数据的公共储存库的目录。The directory that serves as a common repository for application-specific data that is used by the current, non-roaming user.

LocalizedResources 57

包含本地化资源数据的文件系统目录。The file system directory that contains localized resource data. 已添加到 .NET Framework 4 中。Added in the .NET Framework 4.

MyComputer 17

“我的计算机”文件夹。The My Computer folder. 传递给 Environment.GetFolderPath 方法时,MyComputer 枚举成员始终生成空字符串(""),这是因为没有为“我的电脑”文件夹定义路径。When passed to the Environment.GetFolderPath method, the MyComputer enumeration member always yields the empty string ("") because no path is defined for the My Computer folder.

MyDocuments 5

“我的文档”文件夹。The My Documents folder. 此成员等效于 PersonalThis member is equivalent to Personal.

MyMusic 13

“我的音乐”文件夹。The My Music folder.

MyPictures 39

“我的图片”文件夹。The My Pictures folder.

MyVideos 14

充当属于某个用户的视频的存储库的文件系统目录。The file system directory that serves as a repository for videos that belong to a user. 已添加到 .NET Framework 4 中。Added in the .NET Framework 4.

NetworkShortcuts 19

文件系统目录,包含“网上邻居”虚拟文件夹中可能存在的链接对象。A file system directory that contains the link objects that may exist in the My Network Places virtual folder. 已添加到 .NET Framework 4 中。Added in the .NET Framework 4.

Personal 5

用作文档的公共储存库的目录。The directory that serves as a common repository for documents. 此成员等效于 MyDocumentsThis member is equivalent to MyDocuments.

PrinterShortcuts 27

文件系统目录,包含“打印机”虚拟文件夹中可能存在的链接对象。The file system directory that contains the link objects that can exist in the Printers virtual folder. 已添加到 .NET Framework 4 中。Added in the .NET Framework 4.

ProgramFiles 38

“Program files”目录。The program files directory.

在非 x86 系统中,将 ProgramFiles 传递到 GetFolderPath(Environment+SpecialFolder) 方法将返回非 x86 程序的路径。On a non-x86 system, passing ProgramFiles to the GetFolderPath(Environment+SpecialFolder) method returns the path for non-x86 programs. 若要在非 x86 系统上获取 x86 程序文件目录,请使用 ProgramFilesX86 成员。To get the x86 program files directory on a non-x86 system, use the ProgramFilesX86 member.

ProgramFilesX86 42

x86 “Program Files”文件夹。The x86 Program Files folder. 已添加到 .NET Framework 4 中。Added in the .NET Framework 4.

Programs 2

包含用户程序组的目录。The directory that contains the user's program groups.

Recent 8

包含用户最近使用过的文档的目录。The directory that contains the user's most recently used documents.

Resources 56

包含资源数据的文件系统目录。The file system directory that contains resource data. 已添加到 .NET Framework 4 中。Added in the .NET Framework 4.

SendTo 9

包含“发送”菜单项的目录。The directory that contains the Send To menu items.

StartMenu 11

包含“开始”菜单项的目录。The directory that contains the Start menu items.

Startup 7

对应于用户的“开始”程序组的目录。The directory that corresponds to the user's Startup program group. 只要用户登录或启动 Windows,系统就会启动这些程序。The system starts these programs whenever a user logs on or starts Windows.

System 37

“System”目录。The System directory.

SystemX86 41

Windows “系统”文件夹。The Windows System folder. 已添加到 .NET Framework 4 中。Added in the .NET Framework 4.

Templates 21

用作文档模板的公共储存库的目录。The directory that serves as a common repository for document templates.

UserProfile 40

用户的配置文件文件夹。The user's profile folder. 应用程序不应在此级别上创建文件或文件夹;它们应将其数据放在 ApplicationData 所引用的位置之下。Applications should not create files or folders at this level; they should put their data under the locations referred to by ApplicationData. 已添加到 .NET Framework 4 中。Added in the .NET Framework 4.

Windows 36

Windows 目录或 SYSROOT。The Windows directory or SYSROOT. 它与 %windir% 或 %SYSTEMROOT% 环境变量相对应。This corresponds to the %windir% or %SYSTEMROOT% environment variables. 已添加到 .NET Framework 4 中。Added in the .NET Framework 4.

示例

下面的示例演示如何将Environment.SpecialFolder Environment.GetFolderPath与方法结合使用来获取系统目录。The following example shows how to use Environment.SpecialFolder with the Environment.GetFolderPath method to get the System directory.

// Sample for the Environment::GetFolderPath method
using namespace System;
int main()
{
   Console::WriteLine();
   Console::WriteLine( "GetFolderPath: {0}", Environment::GetFolderPath( Environment::SpecialFolder::System ) );
}

/*
This example produces the following results:

GetFolderPath: C:\WINNT\System32
*/
// Sample for the Environment.GetFolderPath method
using System;

class Sample 
{
    public static void Main() 
    {
    Console.WriteLine();
    Console.WriteLine("GetFolderPath: {0}", 
                 Environment.GetFolderPath(Environment.SpecialFolder.System));
    }
}
/*
This example produces the following results:

GetFolderPath: C:\WINNT\System32
*/
' Sample for the Environment.GetFolderPath method
Class Sample
   Public Shared Sub Main()
      Console.WriteLine()
      Console.WriteLine("GetFolderPath: {0}", Environment.GetFolderPath(Environment.SpecialFolder.System))
   End Sub
End Class
'
'This example produces the following results:
'
'GetFolderPath: C:\WINNT\System32
'

注解

系统特殊文件夹是包含常见信息的文件夹, 例如程序文件程序系统启动The system special folders are folders such as Program Files, Programs, System, or Startup, which contain common information. 默认情况下, 特殊文件夹由系统设置, 或在安装 Windows 版本时由用户显式设置。Special folders are set by default by the system, or explicitly by the user, when installing a version of Windows.

Environment.GetFolderPath方法返回与此枚举关联的位置。The Environment.GetFolderPath method returns the locations associated with this enumeration. 这些文件夹的位置在不同的操作系统上可能具有不同的值, 用户可以更改某些位置, 并且这些位置已本地化。The locations of these folders can have different values on different operating systems, the user can change some of the locations, and the locations are localized.

有关特殊文件夹的详细信息, 请参阅 Windows 文档中的KNOWNFOLDERID常量。For more information about special folders, see the KNOWNFOLDERID constants in the Windows documentation.

适用于