Note

Access to this page requires authorization. You can try signing in or .

Access to this page requires authorization. You can try .

StorageFile.GetFileFromPathAsync(String) Method

Definition

Namespace:
Windows.Storage

Important

Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.

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

public:
 static IAsyncOperation<StorageFile ^> ^ GetFileFromPathAsync(Platform::String ^ path);
/// [Windows.Foundation.Metadata.RemoteAsync]
 static IAsyncOperation<StorageFile> GetFileFromPathAsync(winrt::hstring const& path);
[Windows.Foundation.Metadata.RemoteAsync]
public static IAsyncOperation<StorageFile> GetFileFromPathAsync(string path);
function getFileFromPathAsync(path)
Public Shared Function GetFileFromPathAsync (path As String) As IAsyncOperation(Of StorageFile)

Parameters

path
String

Platform::String

winrt::hstring

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

When this method completes, it returns the file as a StorageFile.

Attributes

Exceptions

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

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

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

Applies to

See also


Feedback

Was this page helpful?