StorageFile class provides different methods with the help of which we can retrieve the file size of a give StorageFile.
In the given function below we retrieve the file size of a given StorageFile using GetBasicPropertiesAsync() method. This method returns the basic properties of the given Storagefile in form of class object from which we can get the size of the given StorageFile.
Note:The property size of basicproperties object returns the file size in Ulong data type.
To convert the ulong type to proper file size in form of Bytes, Kilobytes or MB we have used the CalculateSize helper function.