StorageFile.GetFileFromPathAsync(String) StorageFile.GetFileFromPathAsync(String) StorageFile.GetFileFromPathAsync(String) StorageFile.GetFileFromPathAsync(String) StorageFile.GetFileFromPathAsync(String) Method

Definition

Gets a StorageFile object to represent the file at the specified path.

public : static IAsyncOperation<StorageFile> GetFileFromPathAsync(Platform::String path)
static IAsyncOperation<StorageFile> GetFileFromPathAsync(winrt::hstring path) const;
public static IAsyncOperation<StorageFile> GetFileFromPathAsync(String path)
Public Shared Function GetFileFromPathAsync(path As String) As IAsyncOperation(Of StorageFile)
Windows.Storage.StorageFile.getFileFromPathAsync(path).done( /* Your success and error handlers */ );

Parameters

path
String String String

The path of the file to get a StorageFile to represent.

If your path uses slashes, make sure you use backslashes (\). Forward slashes (/) are not accepted by this method.

Returns

Exceptions

FileNotFoundException FileNotFoundException FileNotFoundException

The specified file does not exist. Check the value of path.

UnauthorizedAccessException UnauthorizedAccessException UnauthorizedAccessException

You don't have permission to access the specified file. For more information, see File access permissions.

ArgumentException ArgumentException ArgumentException

The path cannot be a relative path or a Uri. Check the value of path.

See also