IStorageFolderQueryOperations.GetItemsAsync(UInt32, UInt32) 方法

定义

检索指定范围内的列表项,如文件、文件夹或文件组, (浅层枚举) 。

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

参数

startIndex
UInt32

unsigned int

uint32_t

范围中第一项的从零开始的索引。 此参数的默认值为 0。

maxItemsToRetrieve
UInt32

unsigned int

uint32_t

要检索的最大项数。 使用 -1 检索所有项。

返回

此方法成功完成后,它将返回一个列表 (类型 IVectorView) 项。 每个项都是 IStorageItem 类型,表示文件、文件夹或文件组。

在此列表中,文件由 StorageFile 对象表示,文件夹或文件组由 StorageFolder 对象表示。

属性

适用于

另请参阅