Expand Minimize

StorageFolder.Path | path property

Applies to Windows and Windows Phone

Gets the full path of the current folder in the file system, if the path is available.

Syntax


public string Path { get; }

Property value

Type: String [JavaScript] | System.String [.NET] | Platform::String [C++]

The full path of the current folder in the file system, if the path is available.

Remarks

Don't rely on this property to access a folder, because a file system path is not available for some folders. For example, in the following cases, the folder may not have a file system path, or the file system path may not be available.

  • The folder represents a container for a group of files (for example, the return value from some overloads of the GetFoldersAsync method) instead of an actual folder in the file system.
  • The folder is backed by a URI.
  • The folder was picked by using a file picker.

The Path property is also supported in desktop apps.

Examples

The following example gets the app's installation folder and displays the value of the folder's Path.


using Windows.Storage;
using System.Diagnostics; // For writing results to the Output window.
...
            // Get the app's installation folder.
            StorageFolder appFolder =
                Windows.ApplicationModel.Package.Current.InstalledLocation;

            // Print the folder's path to the Visual Studio Output window.
            Debug.WriteLine(appFolder.Name + " folder path: " + appFolder.Path);


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

StorageFolder

 

 

Show:
© 2014 Microsoft