2013-01-05 19 views

Antwort

9

hier Sie Also:


storageFile.getBasicPropertiesAsync().then(
    function (basicProperties) { 
     var size = basicProperties.size; 
    } 
); 
+0

froh, dass ich helfen konnte –

+0

Hauptstadt G auf GetBasicPropertiesAsync für was es wert ist. – ickydime

0

Haben Sie versucht:

 
     create_task(file->GetBasicPropertiesAsync()).then([this, file](BasicProperties^ basicProperties) 
     { 
      String^ dateModifiedString = dateFormat->Format(basicProperties->DateModified) + " " + timeFormat->Format(basicProperties->DateModified); 
      OutputTextBlock->Text += "\nFile size: " + basicProperties->Size.ToString() + " bytes" + "\nDate modified: " + dateModifiedString; 

     }); 

See: http://msdn.microsoft.com/en-us/library/windows/apps/windows.storage.fileproperties.basicproperties.size.aspx

+0

Er braucht die Antwort in [tag: C#], nicht C++ –

+0

lol, kannst du deine Frage editieren und sie dort einfügen :) –

+0

:)) endlich geschafft! Ich bin so neu hier: D –

11

In C#:

StorageFile file = await openPicker.PickSingleFileAsync(); 
BasicProperties pro = await file.GetBasicPropertiesAsync(); 
if (pro.Size != 0){} 

Sie shoul d unter Verwendung von Windows.Storage.FileProperties für BasicProperties.