ResourceManager.GetResourceFileName(CultureInfo) 方法


生成给定的 CultureInfo 对象的资源文件的名称。Generates the name of the resource file for the given CultureInfo object.

 virtual System::String ^ GetResourceFileName(System::Globalization::CultureInfo ^ culture);
protected virtual string GetResourceFileName (System.Globalization.CultureInfo culture);
abstract member GetResourceFileName : System.Globalization.CultureInfo -> string
override this.GetResourceFileName : System.Globalization.CultureInfo -> string
Protected Overridable Function GetResourceFileName (culture As CultureInfo) As String



构造资源文件名的区域性对象。The culture object for which a resource file name is constructed.


可用于给定的 CultureInfo 对象的资源文件的名称。The name that can be used for a resource file for the given CultureInfo object.


GetResourceFileName当您编写自己的派生ResourceManager自类的类时,方法才有用。The GetResourceFileName method is useful only if you write your own class that derives from the ResourceManager class.

此方法使用CultureInfo.Name属性作为除固定区域性以外的所有区域性的文件名的一部分。This method uses the CultureInfo.Name property as part of the file name for all cultures other than the invariant culture. 此方法不会在程序集的清单中查找或触摸磁盘,只用于构造资源文件名(适用于传递到ResourceReader构造函数)或清单资源 blob 名称。This method does not look in an assembly's manifest or touch the disk, and is used only to construct a resource file name (suitable for passing to the ResourceReader constructor) or a manifest resource blob name.

派生类可以重写此方法,以便查找其他扩展,例如 ""。ResX ",或用于命名资源文件的完全不同的方案。A derived class can override this method to look for a different extension, such as ".ResX", or a completely different scheme for naming resource files. 请注意,可以使用方法自定义附属程序集中的资源文件的名称,而不是自定义附属程序集本身的名称。Note that the method can be used to customize the name of a resource file within a satellite assembly, and not to customize the name of the satellite assembly itself.


当通过诸如InvokeMember(String, BindingFlags, Binder, Object, Object[], ParameterModifier[], CultureInfo, String[])等机制后期绑定调用时。when invoked late-bound through mechanisms such as InvokeMember(String, BindingFlags, Binder, Object, Object[], ParameterModifier[], CultureInfo, String[]). 关联枚举:MemberAccessAssociated enumeration: MemberAccess.