我试图调用CancelAsync
,虽然webClient
的作用域已经超出了范围。
private void Download_Click(object sender, EventArgs e)
{
WebClient webClient = new WebClient();
}
private void Button1_Click(object sender, EventArgs e)
{
webClient.CancelAsync();
}
请问有人可以展示一下如何在此事件处理程序中调用webClient.CancelAsync()
吗?