語言

ResourceLoader.GetString(String) 方法

定義

回傳資源最合適的字串值,由資源識別碼指定。

public:
 virtual Platform::String ^ GetString(Platform::String ^ resourceId) = GetString;
winrt::hstring GetString(winrt::hstring const& resourceId);
public string GetString(string resourceId);
function getString(resourceId)
Public Function GetString (resourceId As String) As String

參數

resourceId
String

Platform::String

winrt::hstring

待解析資源的資源識別碼。

Note

資源識別碼被視為統一資源識別碼(URI)片段,並受統一資源識別碼(URI)語意限制。 例如, getString (「Caption%20」)會被視為 getString (「Caption」)。 不要在資源識別碼中使用「?」或「#」,因為它們會終止資源路徑。 例如,「Foo?3」會被視為「Foo」。

傳回

String

Platform::String

winrt::hstring

預設 ResourceContext 中指定資源最合適的字串值。

範例

請參考 ResourceLoader 中的範例。

適用於

另請參閱