locked
Size of file in winrt

    General discussion

  • Hi,

    How to find size of a file in winRT?

    Thanks

    AKEV

    Wednesday, October 24, 2012 5:22 AM

All replies

  • Thanks for the reply.

    But how can i get the object of BasicProperites?

    Suppose i have only file handler of a file, how can i find the size of the file using it

    Wednesday, October 24, 2012 9:23 AM
  • Please see the following

    // Get basic properties
            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;
    
            });


    BasicProperties.Size

    BasicProperties

    Wednesday, October 24, 2012 11:29 AM
  • // Get basic properties
            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;
    
            })



    Wednesday, October 24, 2012 11:30 AM