Returns the value of the specified resource. The resource that is returned is localized for the culture determined by the current cultural settings of the current Thread (this is accomplished via the culture's CurrentUICulture property). If the resource has not been localized for that culture, the resource that is returned is localized for a "best match" (this is accomplished via the Parent property). Otherwise, a a null reference (in Visual Basic Nothing) reference is returned.
[Visual Basic] Overloads Overridable Public Function GetString( _ ByVal name As String _ ) As String [C#] public virtual string GetString( string name ); [C++] public: virtual String* GetString( String* name ); [JScript] public function GetString( name : String ) : String;
The value of the resource localized for the caller's current culture settings. If a match is not possible, a null reference (Nothing) is returned.
Exception Type | Condition |
---|---|
ArgumentNullException | The name parameter is a null reference (Nothing). |
InvalidOperationException | The value of the specified resource is not a string. |
ResourceManager Class | ResourceManager Members | System.Resources Namespace | ResourceManager.GetString Overload List