我正在尝试使用 StorageFile
方法 CreateStreamedFileFromUriAsync
下载文件,但我对 IRandomAccessStreamReference
参数感到困惑。如何传递 IRandomAccessStreamReference?它是一个接口(interface)。我该怎么办?
public static IAsyncOperation<StorageFile> CreateStreamedFileFromUriAsync(
string displayNameWithExtension,
Uri uri,
IRandomAccessStreamReference thumbnail
)
最佳答案
我找到了答案:
IRandomAccessStreamReference thumbnail =
RandomAccessStreamReference.CreateFromUri(new Uri(remoteUri));
IAsyncOperation<StorageFile> file1 =
StorageFile.CreateStreamedFileFromUriAsync("duyuru.pdf", new Uri(remoteUri), thumbnail);
关于c# - CreateStreamedFileFromUriAsync : How can i pass a IRandomAccessStreamReference?,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/14527233/