【发布时间】:2018-09-17 12:50:15
【问题描述】:
在我的 UWP 应用程序中,我使用此构造来获取所有 StorageDevices 的列表:
List<StorageFolder> list = new List<StorageFolder>();
var selector = Windows.Devices.Portable.StorageDevice.GetDeviceSelector();
var devices = await Windows.Devices.Enumeration.DeviceInformation.FindAllAsync(selector);
foreach (Windows.Devices.Enumeration.DeviceInformation device in devices)
{
// Get device root folder
StorageFolder rootFolder = Windows.Devices.Portable.StorageDevice.FromId(device.Id);
list.Add(rootFolder);
}
RemovableItems.DataContext = new RemovableStorageViewModel(list);
如何获取此设备的可用空间和容量?
我尝试从文件夹道具rootFolder.Properties.RetrievePropertiesAsync(new List<string>()) 中获取它,但是这个道具不见了。
更新:
为什么缺少可用空间和容量?
【问题讨论】:
-
This answer 可能帮助不大。
-
@Romasz 不。我知道如何从标准文件夹中获取此道具,但在我的情况下它不起作用。
标签: c# win-universal-app