3
我想拨打CancelAsync
,但webClient
超出范围。帮助功能超出范围(C#)
private void Download_Click(object sender, EventArgs e)
{
WebClient webClient = new WebClient();
}
private void Button1_Click(object sender, EventArgs e)
{
webClient.CancelAsync();
}
有人能告诉我如何webClient.CancelAsync()
可以从这个事件处理函数中调用请
@詹姆斯·巴特勒:欢迎... –
注意,如果用户点击了两次DownloadButton不取消,这打破。 – CodesInChaos