在 Windows phone 中获取可用存储空间 space 8.1

Fetching available storage space in Windows phone 8.1

WP8.1 SDK中是否有API获取phone可用存储空间space?

我说的不是应用程序本地存储,而是 phones 存储。

您可以获取您的应用程序在他的本地文件夹中有多少免费 space。

public async Task<UInt64> GetLocalFolderFreeSpaceAsync()
    {
        var retrivedProperties =
            await ApplicationData.Current.LocalFolder.Properties.RetrievePropertiesAsync(new string[] {"System.FreeSpace"});
        return (UInt64) retrivedProperties["System.FreeSpace"];
    }