StorageFolder.GetFolderFromPathForUserAsync(User, String) 메서드

정의

지정된 사용자에 대한 파일 시스템의 절대 경로를 기반으로 StorageFolder 를 가져옵니다.

public:
 static IAsyncOperation<StorageFolder ^> ^ GetFolderFromPathForUserAsync(User ^ user, Platform::String ^ path);
/// [Windows.Foundation.Metadata.RemoteAsync]
 static IAsyncOperation<StorageFolder> GetFolderFromPathForUserAsync(User const& user, winrt::hstring const& path);
[Windows.Foundation.Metadata.RemoteAsync]
public static IAsyncOperation<StorageFolder> GetFolderFromPathForUserAsync(User user, string path);
function getFolderFromPathForUserAsync(user, path)
Public Shared Function GetFolderFromPathForUserAsync (user As User, path As String) As IAsyncOperation(Of StorageFolder)

매개 변수

user
User

StorageFolder가 반환되는 사용자입니다.

path
String

Platform::String

winrt::hstring

가져올 폴더의 파일 시스템(Uri 아님)의 절대 경로입니다.

반환

이 메서드가 성공적으로 완료되면 사용자에 대해 지정된 폴더를 나타내는 StorageFolder 를 반환합니다.

특성

Windows 요구 사항

디바이스 패밀리
Windows 10, version 2004 (10.0.19041.0에서 도입되었습니다.)
API contract
Windows.Foundation.UniversalApiContract (v10.0에서 도입되었습니다.)

예제

async Task<StorageFolder> GetStorageFolderAsync(User user, string path) {     
    // It is possible the folder no longer exists     
    // or permissions were changed so that the     
    // app no longer has access to the path.     
    try     
    {         
        return await StorageFolder.GetFolderFromPathForUserAsync(user, path);     
    }     
    catch( System.IO.IOException ex )    
    {         
        // File, or path not found I/O Exceptions can happen  
        // notify user or implement fallback, etc...         
        string message = ex.Message;         
        return null;     
    }     
    catch(System.UnauthorizedAccessException ex)     
    {         
        // Access denied - notify user or implement fallback, etc...         
        string message = ex.Message;         
        return null;
    }

설명

이 메서드는 MUA(다중 사용자 인식)입니다.

적용 대상

추가 정보