Share via


IStorageFolderQueryOperations.GetFilesAsync 方法

定義

多載

GetFilesAsync(CommonFileQuery)

根據指定的查詢 (淺層列舉來擷取檔案清單) 。 這會在某個時間點傳回檔案的快照集,而且不允許您透過事件追蹤變更。

GetFilesAsync(CommonFileQuery, UInt32, UInt32)

根據指定的檔案查詢,擷取指定範圍中的檔案清單。 這會在某個時間點傳回檔案的快照集,而且不允許您透過事件追蹤變更。

GetFilesAsync(CommonFileQuery)

根據指定的查詢 (淺層列舉來擷取檔案清單) 。 這會在某個時間點傳回檔案的快照集,而且不允許您透過事件追蹤變更。

public:
 IAsyncOperation<IVectorView<StorageFile ^> ^> ^ GetFilesAsync(CommonFileQuery query);
/// [Windows.Foundation.Metadata.Overload("GetFilesAsyncOverloadDefaultStartAndCount")]
/// [Windows.Foundation.Metadata.RemoteAsync]
IAsyncOperation<IVectorView<StorageFile>> GetFilesAsync(CommonFileQuery const& query);
[Windows.Foundation.Metadata.Overload("GetFilesAsyncOverloadDefaultStartAndCount")]
[Windows.Foundation.Metadata.RemoteAsync]
public IAsyncOperation<IReadOnlyList<StorageFile>> GetFilesAsync(CommonFileQuery query);
function getFilesAsync(query)
Public Function GetFilesAsync (query As CommonFileQuery) As IAsyncOperation(Of IReadOnlyList(Of StorageFile))

參數

query
CommonFileQuery

要執行的檔案查詢類型。

傳回

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

屬性

另請參閱

適用於

GetFilesAsync(CommonFileQuery, UInt32, UInt32)

根據指定的檔案查詢,擷取指定範圍中的檔案清單。 這會在某個時間點傳回檔案的快照集,而且不允許您透過事件追蹤變更。

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

參數

query
CommonFileQuery

要執行的檔案查詢類型。

startIndex
UInt32

unsigned int

uint32_t

範圍中第一個檔案之以零起始的索引。 這個參數的預設值是 0。

maxItemsToRetrieve
UInt32

unsigned int

uint32_t

要擷取的檔案數目上限。 使用 -1 來擷取所有檔案。

傳回

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

屬性

備註

使用此多載來藉由呈現只包含必要檔案子集的查詢結果虛擬檢視來擷取改善系統效能。

另請參閱

適用於