以编程方式获取可用空间

时间:2016-09-26 06:40:42

标签: c# uwp windows-10-mobile

如何以编程方式获取Universal Windows Phone 10中的可用空间,因为UWP 10中不存在AvailableFreeSpace属性

public long GetFreeSize()
{
    using (var isolatedStorageFile = IsolatedStorageFile.GetUserStoreForApplication())
    {
        var sizeInBytes = isolatedStorageFile.AvailableFreeSpace;//this AvailableFreeSpace proprrty doesnt exist in uwp
        var sizeInKB = sizeInBytes / 1024.0;
        var sizeInMB = sizeInKB / 1024.0;
        var sizeInGB = sizeInMB / 1024.0;
    }

    return (long)0;
}

0 个答案:

没有答案