ResourceManager 類別

定義

表示在執行階段提供特定文化特性資源存取權限的資源管理員。

public ref class ResourceManager
public class ResourceManager
[System.Serializable]
public class ResourceManager
[System.Serializable]
[System.Runtime.InteropServices.ComVisible(true)]
public class ResourceManager
type ResourceManager = class
[<System.Serializable>]
type ResourceManager = class
[<System.Serializable>]
[<System.Runtime.InteropServices.ComVisible(true)>]
type ResourceManager = class
Public Class ResourceManager
繼承
ResourceManager
衍生
屬性

備註

如需此 API 的詳細資訊,請參閱 ResourceManager 的補充 API 備註

建構函式

ResourceManager()

使用預設值,初始化 ResourceManager 類別的新執行個體。

ResourceManager(String, Assembly)

初始化 ResourceManager 類別的新執行個體,這個執行個體會在所指的組件中查閱具有指定根名稱之檔案中的資源。

ResourceManager(String, Assembly, Type)

初始化 ResourceManager 類別的新執行個體,這個執行個體使用指定的 ResourceSet 類別查閱所指組件中具有指定根名稱的檔案所包含的資源。

ResourceManager(Type)

根據指定之型別物件的資訊,初始化可查閱附屬組件中資源之 ResourceManager 類別的新執行個體。

欄位

BaseNameField

指定 ResourceManager 搜尋資源的資源檔之根目錄名稱。

HeaderVersionNumber

指定目前 ResourceManager 的實作能夠解譯和產生的資源檔標頭版本。

MagicNumber

保留用來識別資源檔的編號。

MainAssembly

指定包含資源的主要組件。

ResourceSets
已淘汰.

包含 Hashtable,其傳回從文化特性到 ResourceSet 物件的對應。

屬性

BaseName

取得 ResourceManager 搜尋資源的資源檔之根目錄名稱。

FallbackLocation

取得或設定要擷取預設後援資源的位置。

IgnoreCase

取得或設定值,指出資源管理員是否允許在 GetString(String)GetObject(String) 方法中進行不區分大小寫的資源查詢。

ResourceSetType

取得資源管理員用來建構 ResourceSet 物件之資源集物件的型別。

方法

CreateFileBasedResourceManager(String, String, Type)

傳回 ResourceManager 物件,該物件會搜尋特定目錄而不是資源的組件資訊清單。

Equals(Object)

判斷指定的物件是否等於目前的物件。

(繼承來源 Object)
GetHashCode()

做為預設雜湊函式。

(繼承來源 Object)
GetNeutralResourcesLanguage(Assembly)

藉由擷取指定之組件上的 NeutralResourcesLanguageAttribute 屬性的值,傳回主要組件的預設資源的文化特性資訊。

GetObject(String)

傳回指定的非字串資源的值。

GetObject(String, CultureInfo)

取得針對指定的文化特性當地語系化之所指定非字串資源的值。

GetResourceFileName(CultureInfo)

為所指 CultureInfo 物件產生資源檔的名稱。

GetResourceSet(CultureInfo, Boolean, Boolean)

擷取特定文化特性設定的資源。

GetSatelliteContractVersion(Assembly)

傳回所指組件中 SatelliteContractVersionAttribute 屬性所指定的版本。

GetStream(String)

從指定的資源傳回 Unmanaged 記憶體資料流物件。

GetStream(String, CultureInfo)

使用指定的文化特性,從指定的資源傳回 Unmanged 記憶體資料流物件。

GetString(String)

傳回指定的字串資源的值。

GetString(String, CultureInfo)

傳回為指定文化特性當地語系化之字串資源的值。

GetType()

取得目前執行個體的 Type

(繼承來源 Object)
InternalGetResourceSet(CultureInfo, Boolean, Boolean)

提供用來尋找資源集的實作。

MemberwiseClone()

建立目前 Object 的淺層複製。

(繼承來源 Object)
ReleaseAllResources()

指示資源管理員要呼叫所有 ResourceSet 物件上的 Close() 方法並釋放所有資源。

ToString()

傳回代表目前物件的字串。

(繼承來源 Object)

適用於

執行緒安全性

此型別具備執行緒安全。

另請參閱