0

I want to list name here i save in isolated storage my code is :

public async void  getfile()
{
    string _storageFile = "books.db";
    using (var isolatedStorage = IsolatedStorageFile.GetUserStoreForApplication())
    {
        if (!isolatedStorage.FileExists(_storageFile))
        {

        }
        else
        {
            using (var isoFileStream = isolatedStorage.OpenFile(_storageFile, FileMode.Open))
            {

            }
        }
    }
}

How to get the list of all files?

Toni Petrina
  • 7,014
  • 1
  • 25
  • 34
  • I must agree that I hardly understand what you are trying to do. If you want to list your files you can use [GetFileNames](http://msdn.microsoft.com/en-us/library/windowsphone/develop/cc190395(v=vs.105).aspx) – Romasz Mar 03 '14 at 13:38
  • try this http://stackoverflow.com/questions/3038770/how-do-you-get-a-flat-listing-of-all-files-in-isolatedstorage – A.K. Mar 03 '14 at 13:39

2 Answers2

1

GetFileNames() method would retun you array of filenames:

public async void  getfile()
    { 
        using (var isolatedStorage = IsolatedStorageFile.GetUserStoreForApplication())
        {
            string[] files = isolatedStorage.GetFileNames();
        }
    }
Pradeep Kesharwani
  • 1,480
  • 1
  • 12
  • 21
0

Use IsolatedStorage.GetFileNames to retrieve the list of all files:

public async void  getfile()
{
    string _storageFile = "books.db";
    using (var isolatedStorage = IsolatedStorageFile.GetUserStoreForApplication())
    {
        var files = isolatedStorage.GetFileNames();
    }
}
Toni Petrina
  • 7,014
  • 1
  • 25
  • 34