Expand Minimize

StorageFile.GetFileFromApplicationUriAsync | getFileFromApplicationUriAsync method

Applies to Windows and Windows Phone

Gets a StorageFile object to represent the specified URI app resource. For examples of sample URIs see How to load file resources.

Syntax


public static IAsyncOperation<StorageFile> GetFileFromApplicationUriAsync(
  Uri uri
)

Parameters

uri

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

The URI of the app resource to get a StorageFile to represent.

Return value

Type: IAsyncOperation<StorageFile>

When this method completes, it returns a StorageFile object that represents the URI resource.

Remarks

You can use this method to access your app's resources using either "ms-appx://" or "ms-appdata://" URIs.

Examples


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




Requirements

Minimum supported client

Windows 8

Minimum supported server

Windows Server 2012

Minimum supported phone

Windows Phone 8

Namespace

Windows.Storage
Windows::Storage [C++]

Metadata

Windows.winmd

See also

StorageFile
How to load file resources

 

 

Show:
© 2014 Microsoft