StorageFile.GetFileFromApplicationUriAsync(Uri) Method

Definition

Gets a StorageFile object to represent the specified Uniform Resource Identifier (URI) app resource. For examples of sample URIs see Load images and assets tailored for scale, theme, high contrast, and others.

C#
[Windows.Foundation.Metadata.RemoteAsync]
public static IAsyncOperation<StorageFile> GetFileFromApplicationUriAsync(System.Uri uri);

Parameters

uri
Uri

The Uniform Resource Identifier (URI) of the app resource to get a StorageFile to represent.

Returns

When this method completes, it returns a StorageFile object that represents the Uniform Resource Identifier (URI) resource.

Attributes

Examples

JavaScript
var uri = new Windows.Foundation.Uri("ms-appx:///datafile.xml")
Windows.Storage.StorageFile.getFileFromApplicationUriAsync(uri).done( /* Your success and error handlers */ );

Remarks

You can use this method to access your app's resources using either "ms-appx://" or "ms-appdata://" Uniform Resource Identifier (URI).

Applies to

Product Versions
WinRT Build 10240, Build 10586, Build 14383, Build 15063, Build 16299, Build 17134, Build 17763, Build 18362, Build 19041, Build 20348, Build 22000, Build 22621, Build 26100

See also