我正在尝试检索“ScheduleFolder”下的所有文件名并将其放入列表框中。 我应该怎么做呢? 如何让它显示在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;
答案 0 :(得分:1)
试试这个代码段
IsolatedStorageFile isf = IsolatedStorageFile.GetUserStoreForApplication();
string[] fileNames = isf.GetFileNames("./DirectoryName/*.*");
答案 1 :(得分:0)
我可能会用这个......
IsolatedStorageFile myStore = IsolatedStorageFile.GetUserStoreForApplication();
string[] fileNames = myStore.GetFileNames("./ScheduleFolder/*.*");
scheduleListBox.ItemsSource = fileNames;