Skip to main content
ResourceLoader.GetStringForUri | getStringForUri method

Returns the most appropriate string value of a resource, specified by a Uniform Resource Identifier (URI) resource identifier, for the default ResourceContext of the currently running app.

Syntax


var string = resourceLoader.getStringForUri(uri);

public string GetStringForUri(
  Uri uri
)

Public Function GetStringForUri(
  uri As Uri 
) As String

public:
String^ GetStringForUri(
  Uri^ uri
)

Parameters

uri

Type: Windows.Foundation.Uri [JavaScript] | System.Uri [.NET] | Windows::Foundation::Uri [C++]

A URI that represents the resource to be retrieved.

Return value

Type: String [JavaScript] | System.String [.NET] | Platform::String [C++]

The most appropriate string value of the specified resource for the default ResourceContext.

Remarks

URI objects require a scheme to be identified. In this context, the ms-resource scheme must be specified in the URI passed to the method.

Errors

This method fails with an exception if the supplied URI is for some other protocol, if the requested resource is not found, or if the requested resource is not a string.

Requirements (Windows 10 device family)

Device family

Universal, introduced version 10.0.10240.0

API contract

Windows.Foundation.UniversalApiContract, introduced version 1.0

Namespace

Windows.ApplicationModel.Resources
Windows::ApplicationModel::Resources [C++]

Metadata

Windows.Foundation.UniversalApiContract.winmd

Requirements (Windows 8.x and Windows Phone 8.x)

Minimum supported client

Windows 8.1

Minimum supported server

Windows Server 2012 R2

Minimum supported phone

Windows Phone 8.1 [Windows Runtime apps only]

Namespace

Windows.ApplicationModel.Resources
Windows::ApplicationModel::Resources [C++]

Metadata

Windows.winmd

See also

ResourceLoader