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();
}