• <legend id='gyPVe'><style id='gyPVe'><dir id='gyPVe'><q id='gyPVe'></q></dir></style></legend>
    • <bdo id='gyPVe'></bdo><ul id='gyPVe'></ul>
  • <small id='gyPVe'></small><noframes id='gyPVe'>

    <i id='gyPVe'><tr id='gyPVe'><dt id='gyPVe'><q id='gyPVe'><span id='gyPVe'><b id='gyPVe'><form id='gyPVe'><ins id='gyPVe'></ins><ul id='gyPVe'></ul><sub id='gyPVe'></sub></form><legend id='gyPVe'></legend><bdo id='gyPVe'><pre id='gyPVe'><center id='gyPVe'></center></pre></bdo></b><th id='gyPVe'></th></span></q></dt></tr></i><div id='gyPVe'><tfoot id='gyPVe'></tfoot><dl id='gyPVe'><fieldset id='gyPVe'></fieldset></dl></div>
    <tfoot id='gyPVe'></tfoot>

      1. windows 10 应用程序下载操作未启动

        windows 10 apps DownloadOperation not starting(windows 10 应用程序下载操作未启动)
          <tbody id='JJ5ZX'></tbody>
        <legend id='JJ5ZX'><style id='JJ5ZX'><dir id='JJ5ZX'><q id='JJ5ZX'></q></dir></style></legend>

          • <i id='JJ5ZX'><tr id='JJ5ZX'><dt id='JJ5ZX'><q id='JJ5ZX'><span id='JJ5ZX'><b id='JJ5ZX'><form id='JJ5ZX'><ins id='JJ5ZX'></ins><ul id='JJ5ZX'></ul><sub id='JJ5ZX'></sub></form><legend id='JJ5ZX'></legend><bdo id='JJ5ZX'><pre id='JJ5ZX'><center id='JJ5ZX'></center></pre></bdo></b><th id='JJ5ZX'></th></span></q></dt></tr></i><div id='JJ5ZX'><tfoot id='JJ5ZX'></tfoot><dl id='JJ5ZX'><fieldset id='JJ5ZX'></fieldset></dl></div>
              <bdo id='JJ5ZX'></bdo><ul id='JJ5ZX'></ul>
            • <small id='JJ5ZX'></small><noframes id='JJ5ZX'>

              <tfoot id='JJ5ZX'></tfoot>

                • 本文介绍了windows 10 应用程序下载操作未启动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我正在尝试在 Windows 10 通用应用程序上使用此代码下载文件:

                  I'm trying to download a file using this code on a windows 10 universal app:

                  await downloadOperation.StartAsync().AsTask(token, progressCallback);
                  

                  它可以在电脑上运行,但在移动设备上有时它不会开始下载,甚至在我重新启动移动设备之前都不会出现异常.是系统错误还是我遗漏了什么?

                  it's working on pc but on mobile sometimes it's doesn't start downloading and not even giving an exception until I restart the mobile. Is it a bug in the system or I'm missing something?

                  编辑 1:

                  任务的状态是等待激活",所以它不会抛出异常.它只是在等待,直到我重新启动手机才开始我一直在尝试使用相同的 url,我在电脑上没有这个问题.只和手机有关.该任务的属性如下:

                  the task's status is "waiting for activation" so it's not throwing an exception. it's just waiting and not starting until I restart the phone I'm trying always with the same url and I don't have this problem on the pc. It's about the phone only. The task's properties are the following:

                  推荐答案

                  我终于找到了问题所在.当我开始下载操作并关闭应用程序而不取消操作时,BackgroundDownloader 会为下一次应用程序启动保留该操作.当下载操作的数量达到最大允许同时操作(我认为 5)时,下一个操作将在等待列表()上,直到前一个操作完成.所以当应用程序这样启动时,我不得不停止所有未完成的操作:

                  I found the problem finally. when I start a download operation and close the application without cancelling the operation the BackgroundDownloader keeps the operation for the next application start. when the number of download operations reach the maximum allowed simultaneous operations(I think 5) the next operations will be on the waiting list() till the previous operations finish. so I had to stop all the uncompleted operations when the application starts like this:

                  Task.Run(async () =>
                          {
                              var downloads = await BackgroundDownloader.GetCurrentDownloadsAsync();
                              foreach (var download in downloads)
                              {
                                  CancellationTokenSource cts = new CancellationTokenSource();
                                  download.AttachAsync().AsTask(cts.Token);
                                  cts.Cancel();
                              }
                              var localFolder = ApplicationData.Current.LocalFolder;
                              var files = await localFolder.GetFilesAsync();
                              files = files.Where(x => x.Name.EndsWith("_")).ToList();
                              foreach (StorageFile file in files)
                              {
                                  await file.DeleteAsync(StorageDeleteOption.PermanentDelete);
                              }
                          });
                  

                  这篇关于windows 10 应用程序下载操作未启动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  C# namespace alias - what#39;s the point?(C# 命名空间别名 - 有什么意义?)
                  Using Xpath With Default Namespace in C#(在 C# 中使用具有默认命名空间的 Xpath)
                  Generating an EDMX from a DB2 Database(从 DB2 数据库生成 EDMX)
                  IBM .NET Data Provider Connection String issue with Library List(库列表的 IBM .NET 数据提供程序连接字符串问题)
                  .NET DB2 OLEDB pre-requisites(.NET DB2 OLEDB 先决条件)
                  Referring to Code in IBM.Data.DB2 makes that Assembly Unavailable to the rest of my Solution(引用 IBM.Data.DB2 中的代码使该程序集对我的解决方案的其余部分不可用)
                  <tfoot id='yLUmX'></tfoot>

                • <legend id='yLUmX'><style id='yLUmX'><dir id='yLUmX'><q id='yLUmX'></q></dir></style></legend>
                  • <bdo id='yLUmX'></bdo><ul id='yLUmX'></ul>
                        <tbody id='yLUmX'></tbody>
                    • <small id='yLUmX'></small><noframes id='yLUmX'>

                          <i id='yLUmX'><tr id='yLUmX'><dt id='yLUmX'><q id='yLUmX'><span id='yLUmX'><b id='yLUmX'><form id='yLUmX'><ins id='yLUmX'></ins><ul id='yLUmX'></ul><sub id='yLUmX'></sub></form><legend id='yLUmX'></legend><bdo id='yLUmX'><pre id='yLUmX'><center id='yLUmX'></center></pre></bdo></b><th id='yLUmX'></th></span></q></dt></tr></i><div id='yLUmX'><tfoot id='yLUmX'></tfoot><dl id='yLUmX'><fieldset id='yLUmX'></fieldset></dl></div>