如何停止RunAsync?
CancellatioTokenSource cts = new CancellationTokenSource();
//I thought that it's must work, but it don't
var script = CSharpScript.Create(code: someCode);
await script.RunAsync(cancelletionToken: cts.Token);
void button_click()
{
cts.Cancel()
}
我怎么能这样做。为什么这样的方法需要cancellationToken参数?
你必须在qazxsw poi调用之前执行它,这会阻止执行直到你得到结果,例如:
await