Share via


StorageFile.CreateStreamedFileFromUriAsync 方法

定義

建立 StorageFile 來代表來自指定統一資源識別項 (URI) 資源的資料流程。 當第一次存取代表資料流程的 StorageFile 時,這個方法可讓應用程式視需要下載資料。

public:
 static IAsyncOperation<StorageFile ^> ^ CreateStreamedFileFromUriAsync(Platform::String ^ displayNameWithExtension, Uri ^ uri, IRandomAccessStreamReference ^ thumbnail);
/// [Windows.Foundation.Metadata.RemoteAsync]
 static IAsyncOperation<StorageFile> CreateStreamedFileFromUriAsync(winrt::hstring const& displayNameWithExtension, Uri const& uri, IRandomAccessStreamReference const& thumbnail);
[Windows.Foundation.Metadata.RemoteAsync]
public static IAsyncOperation<StorageFile> CreateStreamedFileFromUriAsync(string displayNameWithExtension, System.Uri uri, IRandomAccessStreamReference thumbnail);
function createStreamedFileFromUriAsync(displayNameWithExtension, uri, thumbnail)
Public Shared Function CreateStreamedFileFromUriAsync (displayNameWithExtension As String, uri As Uri, thumbnail As IRandomAccessStreamReference) As IAsyncOperation(Of StorageFile)

參數

displayNameWithExtension
String

Platform::String

winrt::hstring

要建立的 StorageFile 使用者易記名稱,包括檔案類型副檔名。

uri
Uri Uri

用來建立 StorageFile之資源的統一資源識別項 (URI) 。

thumbnail
IRandomAccessStreamReference

要建立之 StorageFile 的縮圖影像。

針對高品質的縮圖,此縮圖的一個邊緣至少應為 1024 圖元。

傳回

此方法完成時,它會傳回 StorageFile 物件,代表統一資源識別項 (URI) 資源。

屬性

備註

這個方法幾乎相當於 CreateStreamedFileAsync,但使用此方法時,系統會代表應用程式提供 StreamedFileDataRequestedHandler ,並實作此函式,以將指定的 Uri 下載至資料流程處理檔案。

適用於