如何知道WINDOWS OS为隔离存储提供的存储空间?

时间:2011-07-22 12:48:05

标签: c# .net windows isolatedstorage

如何通过 Windows操作系统了解为隔离存储提供的存储空间?

我可以通过任何方法知道这一点财产| C#中的课程?

3 个答案:

答案 0 :(得分:2)

您可以像这样确定隔离存储的可用空间:

using System;
using System.IO;
using System.IO.IsolatedStorage;

public class CheckingSpace
{
    public static void Main()
    {
        // Get an isolated store for this assembly and put it into an
        // IsolatedStoreFile object.
        IsolatedStorageFile isoStore =  IsolatedStorageFile.GetStore(IsolatedStorageScope.User |
            IsolatedStorageScope.Assembly, null, null);

        // Create a few placeholder files in the isolated store.
        new IsolatedStorageFileStream("InTheRoot.txt", FileMode.Create, isoStore);
        new IsolatedStorageFileStream("Another.txt", FileMode.Create, isoStore);
        new IsolatedStorageFileStream("AThird.txt", FileMode.Create, isoStore);
        new IsolatedStorageFileStream("AFourth.txt", FileMode.Create, isoStore);
        new IsolatedStorageFileStream("AFifth.txt", FileMode.Create, isoStore);

        Console.WriteLine(isoStore.AvailableFreeSpace + " bytes of space remain in this isolated store.");
    } // End of Main.
}

答案 1 :(得分:0)

IsoltaedStorage有一个属性AvailableFreeSpace

msdn link

答案 2 :(得分:0)

有两个答案在谈论多少空间。或者,您可能会询问the location,这取决于操作系统:

  

下表显示了在几个常见操作系统上创建隔离存储的根位置。在此根位置下查找Microsoft \ IsolatedStorage目录

如果它们都不是(可用空间,位置),那么您需要编辑您的问题并更清楚地了解您要查找的信息。