Mega Code Archive

 
Categories / C# Book / 07 Stream
 

0583 Enumerating Isolated Storage

An IsolatedStorageFile object also provides methods for listing files in the store: using System; using System.IO; using System.IO.IsolatedStorage; using System.Linq; using System.Text; class Program { static void Main() { using (IsolatedStorageFile f = IsolatedStorageFile.GetUserStoreForDomain()) { using (var s = new IsolatedStorageFileStream("f1.x", FileMode.Create, f)) s.WriteByte(123); using (var s = new IsolatedStorageFileStream("f2.x", FileMode.Create, f)) s.WriteByte(123); foreach (string s in f.GetFileNames("*.*")) Console.Write(s + " "); // f1.x f2.x } } } The output: f1.x f2.x