UploadOperation.AttachAsync 方法

定义

返回可用于监视附加上传的进度和完成情况的异步操作。 调用此方法可让应用附加在以前的应用实例中启动的上传操作。

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 挂起。

适用于