Windows phone 7 如何在列表框中显示独立存储中的文件名?
我正在开发一个应用程序,我必须在列表框中显示文件名,文件由用户创建,并存储在使用独立存储创建的目录中。我不熟悉windows phone编程。我找不到足够的资源来访问独立存储文件???Plzzz帮助 绑定到列表的代码:Windows phone 7 如何在列表框中显示独立存储中的文件名?,windows-phone-7,c#-4.0,listbox,isolatedstorage,Windows Phone 7,C# 4.0,Listbox,Isolatedstorage,我正在开发一个应用程序,我必须在列表框中显示文件名,文件由用户创建,并存储在使用独立存储创建的目录中。我不熟悉windows phone编程。我找不到足够的资源来访问独立存储文件???Plzzz帮助 绑定到列表的代码: private void bindList() { var appStorage = IsolatedStorageFile.GetUserStoreForApplication(); string[] fileL
private void bindList()
{
var appStorage = IsolatedStorageFile.GetUserStoreForApplication();
string[] fileList = appStorage.GetFileNames("/NotesForBible");
listPicker1.ItemsSource = fileList;
}
用于添加文件的代码:
{
var appStorage=IsolatedStorageFile.GetUserStoreForApplication();
创建目录(“NotesForBible”)
我无法查看在列表框中创建的文件
IsolatedStorageFile store = IsolatedStorageFile.GetUserStoreForApplication();
要获取所有文件名的数组,请执行以下操作:
string directory = "whatever";
string[] filenames = store.GetFileNames(directory);
更多信息:谢谢@CedricReinchenbach
string directory = "whatever";
string[] filenames = store.GetFileNames(directory);