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?

有帮助吗?

解决方案

GetFileNames() method would retun you array of filenames:

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

其他提示

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();
    }
}
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top