[UWP] [C#]如何加快从FutureAccessList中检索文件的时间? [英] [UWP][C#] How to speed up the time retrieves files from FutureAccessList?
问题描述
大家好,
我正在开发一个音乐应用程序。在应用程序第一次运行时,它将扫描音乐库中的音乐文件,然后将它们添加到FutureAccessList中,如下所示:
I am developing a music app. On the very first time the app runs, it will scans for music files in Music library and then add them into the FutureAccessList like this:
string token = StorageApplicationPermissions.FutureAccessList.Add(file); // For each file
字符串变量"token"将存储到本地数据库。 下次应用程序运行时,它将使用该字符串 令牌从FutureAccessList中检索文件,如下所示:
The string variable "token" will be stored into a local database. Next time the app runs, it will use that string token to retrieves file from the FutureAccessList like this:
file = await StorageApplicationPermissions.FutureAccessList.GetFileAsync(token);
问题是我有很多文件,可能超过300个文件。检索FutureAccessList中的所有文件需要很长时间,在PC上大约需要4秒,在手机上大约需要30秒。有没有人有理想加快这项任务?
The problem is I have a lot of file, might be over 300 files. It will take a long time to retrieve all of files in the FutureAccessList, it is about 4 seconds on PC and up to 30 seconds on mobile. Is any one has an ideal to speed up this task?
先谢谢。
推荐答案
嗨 电子狗,
Hi Electronic Dog,
我认为一次加载大量文件似乎不合理,而且会占用大量资源。我建议您少量加载文件。例如,您将文件加载到不同的页面中。
I think that loading a large number of files in one time seems not a reasonable idea, and it will consume a lot of resource. I suggest that you load files in more times with small amount. For example, you load the files in different pages.
祝您好运,
Breeze Liu
Breeze Liu
这篇关于[UWP] [C#]如何加快从FutureAccessList中检索文件的时间?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!