2011-07-22 5 views

答えて

2

を持っているあなたは、このようなあなたの分離ストレージのために利用可能なスペースを決定することができますどのくらいのスペースの話を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. 
} 
+0

AvailableFreeSpaceプロパティは.netEngle FrameWork 4.0の機能です.net 3.5に基づいた私のコンソールには表示されません。 – Anirudha

+0

以前のバージョンでは: long spaceLeft =(long)(isoStore.MaximumSize - isoStore.CurrentSize) ; –

+0

ねえ、Thaxxブライアン・ナイト そのは非常に大きなfigure..Doesを与えることが – Anirudha

0

IsoltaedStorageが財産AvailableFreeSpace

msdn link

+0

@downvoter:なぜこのdownvote?受け入れられたコードは私が言っていることを正確に言う。 – Tigran

0

。また、あなたはOSによって異なりますthe location、について尋ねされる可能性があります。

次の表は、分離ストレージは、いくつかの一般的なオペレーティング・システム上で作成されたルートの場所を示しています。このルートの場所にあるMicrosoft \ IsolatedStorageディレクトリを探します。

これらのいずれでもない場合は、質問を編集して、探している情報を明確にする必要があります。

+0

ちょっと、実際には、Windows Xp上で実行されている特定のアプリケーションのために提供される合計容量を知りたい – Anirudha

関連する問題