2
我試圖端口一個應用程序從Windows 8到Windows Phone 7和一個困難時期試圖找出這些線的等效移植從Windows 8到Windows Phone
var localFolder = ApplicationData.Current.LocalFolder;
IReadOnlyList<StorageFile> fileList = await localFolder.GetFilesAsync();
它得到的所有文件從localFolder
並保存在fileList
我可以用
string[] fileList = appStorage.GetFileNames();
凡appStorage
爲0的情況下在Windows Phone做到這一點。但是,如果我使用上面的代碼行,我不能在列表中的文件上使用某些功能,例如我想獲取文件的創建日期,我可以在WinRT中使用file.DateCreated
這不只是時間,我想使文件的列表像我使用的確在Win8中'IReadOnlyList的fileList =等待localFolder.GetFilesAsync();' : ) –
Windows Phone 7中沒有「文件」,就像使用桌面版Windows一樣。您沒有本地「文件夾」,只有IsolatedStorageFile(和IsolatedStorage - 鍵/值存儲)。就像在Windows 8應用程序中使用IsolatedStorageFile與使用文件系統不同一樣。此外,Win8中的所有本地存儲文件功能都不在Windows Phone 7中 –