Win10 UWP get file size from Storagefile

Source: Internet
Author: User
Tags creative commons attribution

This article main: Get File size

    private async Task<ulong> FileSize(Windows.Storage.StorageFile file)    {        var size = await file.GetBasicPropertiesAsync();        return size.Size;    }//32ddd4227a66713e1329214424c4be9b

In the group saw the great God asked me to write, although less, did not see what they said before I did not think, nine developers: 53078485

See also: HTTP://STACKOVERFLOW.COM/QUESTIONS/14168439/HOW-TO-GET-FILE-SIZE-IN-WINRT

Get the user's most recently used file

Generally we have a folder or file is not in our application directory, users need to pick access, then we will let the user pick each time, this is not possible.

How do we get the UWP to remember that the user chooses a file or folder, or that the UWP doesn't let users select files each time

There are actually two ways

    • Mostrecentlyusedlist

    • Futureaccesslist

The first is very simple, the user recently used a file or folder, this can only save 25, I'm here in the pit, he will automatically delete, find the https://msdn.microsoft.com/zh-cn/windows/uwp/files/ How-to-track-recently-used-files-and-folders, in fact, we can use futureaccesslist, this can use 1k, but why only 1k, so little, garbage wr, to give unlimited

If you do not understand the basics, see: http://blog.csdn.net/lindexi_gd/article/details/52041944


This work is licensed under the Creative Commons Attribution-NonCommercial use-Share 4.0 International license agreement in the same way. Welcome to reprint, use, republish, but be sure to keep the article Attribution Lindesi (including Link: http://blog.csdn.net/lindexi_gd), not for commercial purposes, based on the modified works of this article must be issued with the same license. If you have any questions, please contact me.

Win10 UWP get file size from Storagefile

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.