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中 –