2

我正在尝试将应用程序从 Windows 8 移植到 Windows Phone 7,并且很难找出这些行的等价物

var localFolder = ApplicationData.Current.LocalFolder;
IReadOnlyList<StorageFile> fileList = await localFolder.GetFilesAsync();

它从中获取所有文件localFolder并将其保存在fileList

我可以在 Windows Phone 上使用

string[] fileList = appStorage.GetFileNames();

appStorage的实例在哪里IsolatedStorageFile。但是如果我使用上面的代码行,我不能对列表中的文件使用某些函数,比如如果我想获取文件的创建日期,我可以在 WinRT 中使用file.DateCreated

4

1 回答 1

3

如果 appStorage 是 IsolatedStorageFile 类型,则使用 GetCreationTime 方法http://msdn.microsoft.com/en-us/library/system.io.isolatedstorage.isolatedstoragefile.getcreationtime.aspx

于 2012-05-10T20:52:23.547 回答