【发布时间】:2015-04-01 12:44:01
【问题描述】:
我正在开发一个 Windows 应用商店应用程序(Windows 8.1,使用 VS2012),并且我在从特定存储文件夹检索可用/已用空间时遇到问题,该存储文件夹是从储存设备。需要说明的是,此应用程序旨在在桌面上运行,并通过 Storage Device api 与连接到它的 USB 设备交换文件。
这是我到现在为止的:
StorageFolder folder = Windows.Devices.Portable.StorageDevice.FromId(phoneId);
UInt64[] info = new UInt64[] {};
var properties = await folder.Properties.RetrievePropertiesAsync(
new string[] { "System.FreeSpace", "System.Capacity" });
if (properties.ContainsKey("System.FreeSpace") && properties.ContainsKey("System.FreeSpace"))
{
info = new UInt64[] {
(UInt64) properties["System.FreeSpace"],
(UInt64) properties["System.Capacity"]
};
}
return info;
但没有成功,“信息”始终是一个空数组。有什么想法吗?
【问题讨论】:
-
请参阅"Should questions include “tags” in their titles?",其中的共识是“不,他们不应该”!
-
没注意到。谢谢
标签: c# windows-store-apps storage