ResourceManagerStringLocalizer.GetStringSafely(String, CultureInfo) 方法

定义

从 获取资源字符串, ResourceManager 如果未找到匹配项,则返回 null 而不是引发异常。

protected:
 System::String ^ GetStringSafely(System::String ^ name, System::Globalization::CultureInfo ^ culture);
protected string? GetStringSafely (string name, System.Globalization.CultureInfo? culture);
member this.GetStringSafely : string * System.Globalization.CultureInfo -> string
Protected Function GetStringSafely (name As String, culture As CultureInfo) As String

参数

name
String

字符串资源的名称。

culture
CultureInfo

要获取其字符串的 CultureInfo

返回

资源字符串;如果找不到,则为 null

适用于