장난감 연구소

[UWP] UWP앱에서 파일, 폴더 열기 본문

개발/UWP

[UWP] UWP앱에서 파일, 폴더 열기

changi1122 2019. 2. 28. 18:36

UWP앱에서 파일, 폴더 열기

UWP

StorageFile file = await Windows.ApplicationModel.Package.Current.InstalledLocation.GetFileAsync(@"PDF\file.pdf");
await Windows.System.Launcher.LaunchFileAsync(file);

프로젝트 내 PDF 폴더의 file.pdf 파일을 여는 예시이다.

 

UWP

StorageFolder folder = await Windows.ApplicationModel.Package.Current.InstalledLocation.GetFolderAsync(@"PDF\");
await Windows.System.Launcher.LaunchFolderAsync(folder);

프로젝트 내 PDF 폴더를 여는 예시이다.

 

참고자료

Open PDF file from folder inside project in Windows Store App C# - Stack Overflow