2013-04-02 28 views
0

我正在開發一個應用程序,我必須在列表框中顯示文件名,文件由用戶創建並存儲在使用獨立存儲創建的目錄中。我是Windows手機編程的新手。我沒有找到足夠的資源用於隔離存儲文件訪問? Plzzz幫助如何在列表框中顯示來自獨立存儲的文件名?

代碼綁定到列表:

private void bindList() 
     { 
      var appStorage = IsolatedStorageFile.GetUserStoreForApplication(); 

      string[] fileList = appStorage.GetFileNames("/NotesForBible"); 

      listPicker1.ItemsSource = fileList; 

     } 

代碼添加文件:

{

VAR appStorage = IsolatedStorageFile.GetUserStoreForApplication(); appStorage.CreateDirectory(「NotesForBible」);

if (!appStorage.FileExists(fileName)) 
    { 
     using (var file = appStorage.CreateFile("NotesForBible/" + fileName)) 
     { 
      using (var writer = new StreamWriter(file)) 
      { 
       writer.WriteLine(fileContent); 
      } 
     } 
     } 

我不能夠查看列表框中

回答

相關問題