我正在使用 Microsoft.ConfigurationManagement.Messaging 包来使用 BITS。到目前为止,我已经编写了以下代码:
BitsJob job = new BitsJob(BitsJobType.Download, displayName);
BitsJobState jobState;
job.AddFileToJob(new Uri(source), destination); // source & destination are method parameters
job.Resume();
do
{
// Do something with the job as long as its transferring
} while (/*Get job state here*/);
现在我想在 do-while-statement 中检索作业的状态。我找不到BitsJob
返回作业当前状态的实例的属性或方法。有人可以告诉我如何获得当前的工作状态吗?