共用方式為


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 停止回應。

適用於