开发者

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

开发者 https://www.devze.com 2023-03-21 10:02 出处:网络
I am trying to retrieve all the file name under \"ScheduleFolder\" and place it into a listbox. How should i go about doing it?

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)
        {
  开发者_如何学Go         yo = fileNames[0];
        }
        scheduleListBox.Items.Add(yo);
        textBlock1.Text = yo;


Try this snippet

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


I'll probably use this...

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

精彩评论

暂无评论...
验证码 换一张
取 消