none
How to get size of storagefile quickly? RRS feed

  • 问题

  • I want to traverse and get large files in KnownFolder.PictruesLibrary, codes as below:

    IReadOnlyList<StorageFile> fileList = await parentFolder.GetFilesAsync();
                foreach (StorageFile file in fileList)
                {
                    BasicProperties properties = await file.GetBasicPropertiesAsync();
                    if (properties.Size >= 1024 * 1024 * 1024)
                    {
                        largeFileList.Add(file);
                    }
                }

    however, two async function lasts too long time. Is there any interfaces to get filelength more quickly?

    Thanks.

    2014年7月4日 7:18