DataPackageView.GetStorageItemsAsync 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
获取存储在 DataPackageView 对象中的文件和文件夹。
public:
virtual IAsyncOperation<IVectorView<IStorageItem ^> ^> ^ GetStorageItemsAsync() = GetStorageItemsAsync;
/// [Windows.Foundation.Metadata.RemoteAsync]
IAsyncOperation<IVectorView<IStorageItem>> GetStorageItemsAsync();
[Windows.Foundation.Metadata.RemoteAsync]
public IAsyncOperation<IReadOnlyList<IStorageItem>> GetStorageItemsAsync();
function getStorageItemsAsync()
Public Function GetStorageItemsAsync () As IAsyncOperation(Of IReadOnlyList(Of IStorageItem))
返回
DataPackageView 中存储的文件和文件夹数组。
- 属性
示例
if (shareOperation.data.contains(Windows.ApplicationModel.DataTransfer.StandardDataFormats.storageItems)) {
shareOperation.reportStarted();
shareOperation.data.getStorageItemsAsync().then(function (storageItems) {
var fileList = "";
for (var i = 0; i < storageItems.size; i++) {
fileList += storageItems.getAt(i).name;
if (i < storageItems.size - 1) {
fileList += ", ";
}
}
filesDiv = document.createElement("div");
filesDiv.innerText = fileList;
document.body.appendChild(filesDiv);
});
shareOperation.reportCompleted();
}