rob
rob

Reputation: 8410

How can you get the date modified for a windows 8 file?

getting data created for a file is easy

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

but there is no corresponding myFile.DateModified.

is there anyway to get the data modified property ?

Upvotes: 3

Views: 1301

Answers (3)

Tan Silliksaar
Tan Silliksaar

Reputation: 179

(await file.GetBasicPropertiesAsync()).DateModified does the same thing

Upvotes: 0

rob
rob

Reputation: 8410

I could not get BasicProperties, this may have been removed in RP. My solution was the convoluted

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

phew, that was hard work

Upvotes: 1

user1088520
user1088520

Reputation:

According to Ari Polski "You can get date modified through the BasicProperties"

http://social.msdn.microsoft.com/Forums/no/winappswithcsharp/thread/0f3b989a-fb20-4313-b9ea-61aec477dc63

Upvotes: 2

Related Questions