3

我正在尝试使用StorageFile方法 下载文件,CreateStreamedFileFromUriAsync但我对IRandomAccessStreamReference参数感到困惑。如何传递 IRandomAccessStreamReference?它是一个接口。我该怎么办?

public static IAsyncOperation<StorageFile> CreateStreamedFileFromUriAsync(
    string displayNameWithExtension, 
    Uri uri, 
    IRandomAccessStreamReference thumbnail
)
4

1 回答 1

6

我找到了答案:

IRandomAccessStreamReference thumbnail =
    RandomAccessStreamReference.CreateFromUri(new Uri(remoteUri));
IAsyncOperation<StorageFile> file1 =
    StorageFile.CreateStreamedFileFromUriAsync("duyuru.pdf", new Uri(remoteUri), thumbnail);
于 2013-01-27T15:55:20.183 回答