Question

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?

Was it helpful?

Solution

GetFileNames() method would retun you array of filenames:

public async void  getfile()
    { 
        using (var isolatedStorage = IsolatedStorageFile.GetUserStoreForApplication())
        {
            string[] files = isolatedStorage.GetFileNames();
        }
    }

OTHER TIPS

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();
    }
}
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top