2012-06-20 102 views
3

一個文件創建獲取數據是很容易如何獲取修改爲Windows 8文件的日期?

StorageFile myFile = await storageFolder.GetFileAsync("myfile"); 
var dateCreated = myFile.DateCreated; 

,但沒有相應的myFile.DateModified。

有無論如何獲取數據修改後的屬性?

回答

1

我無法得到BasicProperties,這可能已被刪除RP。 我的解決方案是令人費解的

var check = new list<string>(); 
check.Add("System.DateModified"); 
var props = await myFile.Properties.RetrievePropertiesAsync(check); 
var dateModified = props.SingleOrDefault().Value; 

唷,這是艱苦的工作

0

(等待file.GetBasicPropertiesAsync())。DateModified做同樣的事情

相關問題