Share via


StorageFileQueryResult.GetFilesAsync 方法

定義

多載

GetFilesAsync()

擷取查詢結果集中所有檔案的清單。

GetFilesAsync(UInt32, UInt32)

擷取指定範圍內的檔案清單。

GetFilesAsync()

擷取查詢結果集中所有檔案的清單。

public:
 virtual IAsyncOperation<IVectorView<StorageFile ^> ^> ^ GetFilesAsync() = GetFilesAsync;
/// [Windows.Foundation.Metadata.Overload("GetFilesAsyncDefaultStartAndCount")]
/// [Windows.Foundation.Metadata.RemoteAsync]
IAsyncOperation<IVectorView<StorageFile>> GetFilesAsync();
[Windows.Foundation.Metadata.Overload("GetFilesAsyncDefaultStartAndCount")]
[Windows.Foundation.Metadata.RemoteAsync]
public IAsyncOperation<IReadOnlyList<StorageFile>> GetFilesAsync();
function getFilesAsync()
Public Function GetFilesAsync () As IAsyncOperation(Of IReadOnlyList(Of StorageFile))

傳回

當此方法順利完成時,它會傳回一份清單 (類型 IVectorView) StorageFile 物件所代表的檔案。

屬性

另請參閱

適用於

GetFilesAsync(UInt32, UInt32)

擷取指定範圍內的檔案清單。

public:
 virtual IAsyncOperation<IVectorView<StorageFile ^> ^> ^ GetFilesAsync(unsigned int startIndex, unsigned int maxNumberOfItems) = GetFilesAsync;
/// [Windows.Foundation.Metadata.Overload("GetFilesAsync")]
/// [Windows.Foundation.Metadata.RemoteAsync]
IAsyncOperation<IVectorView<StorageFile>> GetFilesAsync(uint32_t const& startIndex, uint32_t const& maxNumberOfItems);
[Windows.Foundation.Metadata.Overload("GetFilesAsync")]
[Windows.Foundation.Metadata.RemoteAsync]
public IAsyncOperation<IReadOnlyList<StorageFile>> GetFilesAsync(uint startIndex, uint maxNumberOfItems);
function getFilesAsync(startIndex, maxNumberOfItems)
Public Function GetFilesAsync (startIndex As UInteger, maxNumberOfItems As UInteger) As IAsyncOperation(Of IReadOnlyList(Of StorageFile))

參數

startIndex
UInt32

unsigned int

uint32_t

要擷取之第一個檔案之以零起始的索引。 此參數預設為 0。

maxNumberOfItems
UInt32

unsigned int

uint32_t

要擷取的檔案數目上限。 使用 (的最大值 UInt32 ,例如 uint.MaxValue C# std::numeric_limits<uint32_t>::max() 中的 C++ 。如果允許隱含轉換) 擷取所有檔案,則 C++ 中的某些程式碼可能會使用 -1 。 如果範圍包含的檔案少於最大數目,則會傳回該範圍中的所有檔案。

傳回

當此方法順利完成時,它會傳回一份清單 (類型 IVectorView) StorageFile 物件所代表的檔案。

屬性

備註

使用此多載來呈現只包含必要檔案子集的查詢結果虛擬化檢視,以改善系統效能。 例如,如果您的應用程式在資源庫中顯示許多檔案,您可以使用此範圍只擷取使用者目前可見的檔案。

另請參閱

適用於