private void GetObject() { getObjectRequest = new GetObjectRequest(bucket, key, localDir, localFileName); getObjectRequest.SetSign(TimeUtils.GetCurrentTime(TimeUnit.SECONDS), 600); if (progressCallback != null) { getObjectRequest.SetCosProgressCallback(progressCallback); } getObjectRequest.SetRange(rangeStart, rangeEnd); getObjectRequest.SetLocalFileOffset(localFileOffset); cosXmlServer.GetObject(getObjectRequest, delegate(CosResult result) { lock (syncExit) { if (isExit) { return; } } if (UpdateTaskState(TaskState.COMPLETED)) { GetObjectResult getObjectResult = result as GetObjectResult; DownloadTaskResult downloadTaskResult = new DownloadTaskResult(); downloadTaskResult.SetResult(getObjectResult); if (successCallback != null) { successCallback(downloadTaskResult); } } }, delegate(CosClientException clientEx, CosServerException serverEx) { lock (syncExit) { if (isExit) { return; } } if (UpdateTaskState(TaskState.FAILED)) { if (failCallback != null) { failCallback(clientEx, serverEx); } } }); }