StorageFolder.Path 속성

정의

경로를 사용할 수 있는 경우 파일 시스템에서 현재 폴더의 전체 경로를 가져옵니다.

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

속성 값

String

Platform::String

winrt::hstring

경로를 사용할 수 있는 경우 파일 시스템에 있는 현재 폴더의 전체 경로입니다.

구현

예제

다음 예제에서는 앱의 설치 폴더를 가져오고 폴더의 경로 값을 표시합니다.

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());

설명

일부 폴더에는 파일 시스템 경로를 사용할 수 없으므로 이 속성을 사용하여 폴더에 액세스하지 마세요. 예를 들어 다음 경우 폴더에 파일 시스템 경로가 없거나 파일 시스템 경로를 사용할 수 없을 수 있습니다.

  • 폴더는 파일 시스템의 실제 폴더 대신 파일 그룹(예: GetFoldersAsync 메서드의 일부 오버로드에서 반환 값)에 대한 컨테이너를 나타냅니다.
  • 폴더는 URI로 백업됩니다.
  • 파일 선택기를 사용하여 폴더를 선택했습니다.

적용 대상