Search code examples
c#filesizewinrt-async

How to get file size in WinRT?


In WinRT there is no FileInfo class, only a StorageFile class.

How can I get the size of a file using the StorageFile class?


Solution

  • So here you go:

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