ResourceManagerGetString Method (String, CultureInfo) |
Returns the value of the string resource localized for the specified culture.
Namespace: System.ResourcesAssembly: mscorlib (in mscorlib.dll) Version: 4.0.0.0
Syntax public virtual string GetString(
string name,
CultureInfo culture
)
Parameters
- name
- Type: SystemString
The name of the resource to get. - culture
- Type: System.GlobalizationCultureInfo
An object that represents the culture for which the resource is localized.
Return Value
Type:
StringThe value of the resource localized for the specified culture, or null if
name cannot be found in a resource set.
Exceptions Exception | Condition |
---|
ArgumentNullException | The name parameter is null. |
InvalidOperationException | The value of the specified resource is not a String. |
MissingManifestResourceException | No usable set of resources has 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