Windows Dev Center

EN
Este conteúdo não está disponível em seu idioma, mas aqui está a versão em inglês.

StorageFile.GetFileFromApplicationUriAsync | getFileFromApplicationUriAsync method

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

Syntax


Windows.Storage.StorageFile.getFileFromApplicationUriAsync(uri).done( /* Your success and error handlers */ );

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 (Windows 10 device family)

Device family

Universal

API contract

Windows.Foundation.UniversalApiContract, introduced version 1.0

Namespace

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

Metadata

Windows.Foundation.UniversalApiContract.winmd

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

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

 

 

Mostrar:
© 2015 Microsoft