BackgroundUploader.GetCurrentUploadsForTransferGroupAsync(group)抛出“Operation Aborted”和“Operation Aborted”。例外 [英] BackgroundUploader.GetCurrentUploadsForTransferGroupAsync(group) throws an "Operation Aborted" exception

查看:53
本文介绍了BackgroundUploader.GetCurrentUploadsForTransferGroupAsync(group)抛出“Operation Aborted”和“Operation Aborted”。例外的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我正在使用IBackgroundTask将文件上传到服务器,我想更新上传信息给用户,所以我每2秒调用一次BackgroundUploader.GetCurrentUploadsForTransferGroupAsync获取上传信息。

I'm uploading files to a server using IBackgroundTask and I want to update upload information to user, so I call BackgroundUploader.GetCurrentUploadsForTransferGroupAsync every 2 seconds to get upload information.

此方法会抛出 "Operation Aborted"反复出现异常,因此我无法在很长一段时间内获得更新的转移信息(用户可能认为转移卡住了)但我找不到任何相关文档。

This method throws a "Operation Aborted" exception repeatedly,  so I can't get updated information for transfer during a long time (user may think transfer is stuck) but I couldn't find any documentation about it.

1 - )有谁知道为什么会这样?

1-) Does anyone know why this happens?

2-)有谁知道如何避免这个问题?

2-) Does anyone know how to avoid this problem?

最好的问候,

CJ

推荐答案

嗨CJ Santos,

Hi C.J. Santos,

由于我没有看到您的代码,所以我不确定问题出在哪里。请参阅官方代码示例"背景传输样本"。
在场景2中,它通过UploadOperation获取BackgroundUploadProgress。

Since I have not saw your code, so I’m not sure where the issue is. Please refer to the official code sample "Background transfer sample". In Scenario 2, it gets BackgroundUploadProgress via UploadOperation.

顺便提一下,每2秒调用一次BackgroundUploader.GetCurrentUploadsForTransferGroupAsync来获取上传信息。我认为这是不合理的。使用UploadOperation将是正确的方向。

By the way, you call BackgroundUploader.GetCurrentUploadsForTransferGroupAsync every 2 seconds to get upload information. I think it’s unreasonable. Use the UploadOperation would be on right direction.

此外,  < span lang ="en-US"style ="font-family:Verdana; font-size:10pt">欢迎
到开发通用Windows应用论坛!

In addition, Welcome to the Developing Universal Windows apps forum!

请阅读粘贴帖子,尤其是

发布指南:主题行标签

Windows 10 SDK和工具的已知问题 
 

Please read the sticky posts, especially the Guide to posting: subject line tags and Known Issues for Windows 10 SDK and Tools  

我们需要知道你项目的类型,你需要自己为标题添加标签。

We need to know your project's type, and you would need to add tag to title by yourself.

最好的问候,

Xavier Eoro

Xavier Eoro


这篇关于BackgroundUploader.GetCurrentUploadsForTransferGroupAsync(group)抛出“Operation Aborted”和“Operation Aborted”。例外的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆