ResourceManagerGetObject Method (String, CultureInfo) |
Gets the value of the specified non-string resource localized for the specified culture.
Namespace: System.ResourcesAssembly: mscorlib (in mscorlib.dll) Version: 4.0.0.0
Syntax public virtual Object GetObject(
string name,
CultureInfo culture
)
Parameters
- name
- Type: SystemString
The name of the resource to get. - culture
- Type: System.GlobalizationCultureInfo
The culture for which the resource is localized. If the resource is not localized for this culture, the resource manager uses fallback rules to locate an appropriate resource.If this value is null, the CultureInfo object is obtained using the culture's CurrentUICulture property.
Return Value
Type:
ObjectThe value of the resource, localized for the specified culture. If an appropriate resource set exists but
name cannot be found, the method returns null.
Exceptions Exception | Condition |
---|
ArgumentNullException | The name parameter is null. |
MissingManifestResourceException | No usable set of resources have been found, and there are no neutral culture resources. For information about how to handle this exception, see the "Handling MissingManifestResourceException and MissingSatelliteAssemblyException Exceptions" section in the ResourceManager class topic. |
MissingSatelliteAssemblyException | The default culture's resources reside in a satellite assembly that could not be found. For information about how to handle this exception, see the "Handling MissingManifestResourceException and MissingSatelliteAssemblyException Exceptions" section in the ResourceManager class topic. |
See Also