简体   繁体   中英

windows phone 7 File Listing IsolatedStorage

i have a problem when i want get list of file in a directory

this is my code

try
        {
            using (var store = IsolatedStorageFile.GetUserStoreForApplication())
            {
                StringBuilder sb = new StringBuilder();
                string subDir = Path.Combine("NotesYours", "Notes");
                if (store.DirectoryExists(subDir))
                {

                    string searchPath = Path.Combine(subDir, "*");
                    string[] fileInSubDir = store.GetFileNames(searchPath);
                    tbtbtes.Text = fileInSubDir.Length.ToString();
                }
                else
                {
                    MessageBox.Show("dir not exist");
                }
            }
        }
        catch (IsolatedStorageException)
        {

        }

length if fileInSubDir is zero, whereas i have created three file before, So it must be the Length of fileInSubDir is Three, not zero

please help me :(

I half remember a bug which meant wildcard searches just using * in GetFileNames didn't work correctly.
Have you verified that the files are there or tried using a less generic search term?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM