System.Resources Namespace

System.Resources 命名空间提供各种类和接口,这些类和接口使开发人员可以创建、存储和管理在应用程序中使用的不同特定于区域性的资源。 The System.Resources namespace provides classes and interfaces that allow developers to create, store, and manage various culture-specific resources used in an application. System.Resources 命名空间最重要的类之一是 ResourceManager 类。 One of the most important classes of the System.Resources namespace is the ResourceManager class.

MissingManifestResourceException

主程序集不包含非特定区域性的资源和适当的附属程序集缺少时引发的异常。The exception that is thrown if the main assembly does not contain the resources for the neutral culture, and an appropriate satellite assembly is missing.

MissingSatelliteAssemblyException

默认区域性资源的附属程序集丢失时引发的异常。The exception that is thrown when the satellite assembly for the resources of the default culture is missing.

NeutralResourcesLanguageAttribute

通知应用程序默认区域性的资源控制器。Informs the resource manager of an app's default culture. 此类不能被继承。This class cannot be inherited.

ResourceManager

表示资源管理器,其可在运行时提供对于特定文化资源的便利访问Represents a resource manager that provides convenient access to culture-specific resources at run time.

ResourceReader

通过读取顺序资源名称/值对枚举二进制资源 (.resources) 文件的资源。Enumerates the resources in a binary resources (.resources) file by reading sequential resource name/value pairs.

ResourceSet

存储已针对某个特定区域性进行了本地化的所有资源,忽略所有其他区域性(包括任何代用规则)。Stores all the resources localized for one particular culture, ignoring all other cultures, including any fallback rules.

ResourceWriter

以系统默认的格式将资源写入输出文件或输出流。Writes resources in the system-default format to an output file or an output stream. 此类不能被继承。This class cannot be inherited.

ResXDataNode

表示 XML 资源 (.resx) 文件中的元素。Represents an element in an XML resource (.resx) file.

ResXFileRef

表示指向外部资源的链接。Represents a link to an external resource.

ResXFileRef.Converter

提供类型转换器以便将 ResXFileRef 的数据与字符串来回转换。Provides a type converter to convert data for a ResXFileRef to and from a string.

ResXResourceReader

枚举 XML 资源 (.resx) 文件和流,并读取顺序资源名称和值对。Enumerates XML resource (.resx) files and streams, and reads the sequential resource name and value pairs.

ResXResourceSet

表示 XML 资源 (.resx) 文件中的所有资源。Represents all resources in an XML resource (.resx) file.

ResXResourceWriter

将资源写入 XML 资源 (.resx) 文件或输出流。Writes resources in an XML resource (.resx) file or an output stream.

SatelliteContractVersionAttribute

指示 ResourceManager 对象要求附属程序集的特定版本。Instructs a ResourceManager object to ask for a particular version of a satellite assembly.

接口

IResourceReader

提供从资源文件读取数据的基本功能。Provides the base functionality for reading data from resource files.

IResourceWriter

提供将资源写到输出文件或输出流的基本功能。Provides the base functionality for writing resources to an output file or stream.

枚举

UltimateResourceFallbackLocation

指定 ResourceManager 对象是否在主程序集或在附属程序集中查找应用的默认区域性的资源。Specifies whether a ResourceManager object looks for the resources of the app's default culture in the main assembly or in a satellite assembly.

注解

ResourceManager类使用户可以对存储在主程序集或附属程序集中资源的访问和控制资源。The ResourceManager class allows the user to access and control resources stored in the main assembly or in resource satellite assemblies. 使用GetObjectGetString方法来检索特定于区域性的对象和字符串。Use the GetObject and GetString methods to retrieve culture-specific objects and strings.