UploadOperation.AttachAsync 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
返回可用于监视附加上传的进度和完成情况的异步操作。 调用此方法可让应用附加在以前的应用实例中启动的上传操作。
public:
virtual IAsyncOperationWithProgress<UploadOperation ^, UploadOperation ^> ^ AttachAsync() = AttachAsync;
/// [Windows.Foundation.Metadata.RemoteAsync]
IAsyncOperationWithProgress<UploadOperation, UploadOperation const&> AttachAsync();
[Windows.Foundation.Metadata.RemoteAsync]
public IAsyncOperationWithProgress<UploadOperation,UploadOperation> AttachAsync();
function attachAsync()
Public Function AttachAsync () As IAsyncOperationWithProgress(Of UploadOperation, UploadOperation)
返回
使用回调的上传操作。
- 属性
示例
function AttachUpload (loadedUpload) {
try {
upload = loadedUpload;
promise = upload.attachAsync().then(complete, error, progress);
} catch (err) {
displayError(err);
}
};
注解
虽然可以从多个应用实例调用此方法,但开发人员不应在后台任务中附加主应用实例的回调。 这将导致 BackgroundTransferHost.exe 挂起。