beny lim
beny lim

Reputation: 1304

Retrieving file name of a specify folder in isolated storage windows phone 7

I am trying to retrieve all the file name under "ScheduleFolder" and place it into a listbox. How should i go about doing it? How to let it show into the scheduleListBox?

       IsolatedStorageFile myStore = IsolatedStorageFile.GetUserStoreForApplication();
       string[] fileNames = myStore.GetFileNames("./ScheduleFolder/*.*");

        foreach (string name1 in fileNames)
        {
           yo = fileNames[0];
        }
        scheduleListBox.Items.Add(yo);
        textBlock1.Text = yo;

Upvotes: 0

Views: 923

Answers (2)

Anas iqbal
Anas iqbal

Reputation: 1044

I'll probably use this...

IsolatedStorageFile myStore = IsolatedStorageFile.GetUserStoreForApplication();
string[] fileNames = myStore.GetFileNames("./ScheduleFolder/*.*");
scheduleListBox.ItemsSource = fileNames;

Upvotes: 0

Waleed
Waleed

Reputation: 3145

Try this snippet

IsolatedStorageFile isf = IsolatedStorageFile.GetUserStoreForApplication();
string[] fileNames = isf.GetFileNames("./DirectoryName/*.*");

Upvotes: 1

Related Questions