大网数据广告活动
网络与域名解析

Completing and Canceling a Job

· 52CE 我爱测

To complete a transfer job, call the IBackgroundCopyJob Complete method.

To complete a transfer job, call the IBackgroundCopyJob::Complete method. For download jobs, you can call the Complete method before all files in the job have been transferred (before the job's state is BG_JOB_STATE_TRANSFERRED). Only those files that BITS successfully transferred to the client before you called the Complete method are available to the user.

For upload jobs, call the Complete method only if the job's state is BG_JOB_STATE_TRANSFERRED. To determine when the job's state is BG_JOB_STATE_TRANSFERRED, poll the job's state property or register to receive BG_NOTIFY_JOB_TRANSFERRED event notification.

To cancel a transfer job, call the IBackgroundCopyJob::Cancel method. The Cancel method removes the job from the transfer queue and removes the temporary files from the client. Typically, you call this method if you are unable to resolve an error associated with the job.

The Cancel method cancels an upload if the upload is not complete. If the upload is complete, and the job is of type BG_JOB_TYPE_UPLOAD_REPLY, the method cancels the reply.

If you do not call the Complete method or the IBackgroundCopyJob::Cancel method within 90 days (default JobInactivityTimeout Group Policy), the service cancels the job. If the service cancels the job, the downloaded files and the reply file are not available to the client; job cancellation does not affect files that have been successfully uploaded. You should always call the Complete or the Cancel method and not rely on the JobInactivityTimeout policy to cleanup your jobs. Jobs left in the queue may prevent users from creating other jobs if the MaxJobsPerUser or MaxJobsPerMachine policy limit is reached.

Source: Microsoft Learn / Windows Win32 documentation by Microsoft and contributors. Documentation licensed CC BY 4.0. Code samples are covered by the MIT License. Converted from Markdown, with links normalized and embedded media omitted.

资料来源与适用范围

资料来源
Microsoft Learn / Windows Win32 documentation
适用范围
Windows Win32 API · Source date 05/31/2018
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY 4.0 (documentation), MIT (code samples)

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。