StorageFolder.Path StorageFolder.Path StorageFolder.Path StorageFolder.Path StorageFolder.Path Property

Definition

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

public : Platform::String Path { get; }
winrt::hstring Path();
public string Path { get; }
Public ReadOnly Property Path As string
var string = storageFolder.path;

Property Value

string string string

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

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);
// Get the app's installation folder.
Windows::Storage::StorageFolder appFolder{ Windows::ApplicationModel::Package::Current().InstalledLocation() };

// Print the path to the debug window.
::OutputDebugString(appFolder.Path().c_str());
 // Get the app's installation folder
 StorageFolder^ appFolder = Windows::ApplicationModel::Package::Current->InstalledLocation;

 //Print the path to the debug window
 String^ path = appFolder->Path;
 OutputDebugString(path->Begin());
/ Get the app's installation folder.
var appFolder = Windows.ApplicationModel.Package.current.installedLocation;

// Print the folder's path to the Visual Studio Output window.
console.log(appFolder.name, "folder path:", appFolder.path);

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.