0
我試圖在UploadAsync完成後將一些數據傳遞給continuation方法。我可以通過使用該方法讀取AsyncState,但我不知道如何從外部設置它?Google雲端存儲.Net API:使用UploadAsync設置AsyncState
這裏是我到目前爲止的例子:
Action<Task<IUploadProgress>> myAction = (input) =>
{
object asyncState = input.AsyncState;
IUploadProgress result = input.Result;
};
Task<IUploadProgress> uploadTask = service.Objects.Insert(myObject, bucketName, stream, "").UploadAsync();
uploadTask.ContinueWith(myAction);
uploadTask.Wait();
感謝。