且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

是什么任务℃之间的差;>和IAsyncOperation<>

更新时间:2022-04-18 07:10:35

IAsyncOperation 是一个地铁异步操作。您可以等待 IAsyncOperation

IAsyncOperation is a metro asynchronous operation. You can await an IAsyncOperation.

不过,您不能使用 IAsyncOperation Task.WhenAll 任务。 WhenAny 。要使用 IAsyncOperation 情况下使用这些方法,你应该叫 StartAsTask 扩展方法,因为这样的:

However, you can't use IAsyncOperation with Task.WhenAll or Task.WhenAny. To use IAsyncOperation instances with these methods, you should call the StartAsTask extension method, as such:

var folder = Windows.Storage.ApplicationData.Current.LocalFolder;
var fileTask = folder.GetFileAsync("text.txt").StartAsTask();