I am trying to download a file using StorageFile method CreateStreamedFileFromUriAsync but i am confused with IRandomAccessStreamReference parameter. How can I pass a IRandomAccessStreamReference? It is an interface. What sould I do?

public static IAsyncOperation<StorageFile> CreateStreamedFileFromUriAsync(
    string displayNameWithExtension, 
    Uri uri, 
    IRandomAccessStreamReference thumbnail
)
有帮助吗?

解决方案

I have found the answer:

IRandomAccessStreamReference thumbnail =
    RandomAccessStreamReference.CreateFromUri(new Uri(remoteUri));
IAsyncOperation<StorageFile> file1 =
    StorageFile.CreateStreamedFileFromUriAsync("duyuru.pdf", new Uri(remoteUri), thumbnail);
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top