2012-01-08 45 views
-1

在將項目從OS 7.0更改爲OS 7.1之前,下面的代碼正在工作。升級後,代碼不工作。將不勝感激幫助如何使這個isolatedStorage作品。升級項目frm OS7.0到OS7.1,GetFilenames不適用於Windows Phone

 

using (var store1 = IsolatedStorageFile.GetUserStoreForApplication()) {

if (store1.DirectoryExists("Contacts")) { strFileName = "Contacts\";

string[] fileList = store1.GetFileNames(strFileName); if (fileList.Length <= 0) { txtBlkMsg.Text = "No Contact file created. "; listBox1.ItemsSource = null; } else { listBox1.ItemsSource = fileList; } } else { txtBlkMsg.Text = "You have not created any contact file "; }

}}

+1

什麼不起作用? GetFileNames拋出一個錯誤或者只是不返回任何東西?你確定你在聯繫人文件夾中有文件嗎? – 2012-01-08 14:36:47

+0

我已添加數據或文件。我真的找不到這個bug。我測試了兩個版本的應用程序:OS7.0和7.1,只有OS7,0的應用程序正在工作。沒有錯誤並經過測試strFilename =「Contacts \\」或strFilename = @「Contacts \」 – MilkBottle 2012-01-09 00:43:29

回答

0

我覺得OS7.1所需的搜索模式。

搜索模式。支持單字符(「?」)和多字符(「*」)通配符。

添加*解決了我的問題。

相關問題