现在我有了这段代码
public void getRankingList(string country,string type)
{
WebClient client = new WebClient();
client.AllowReadStreamBuffering = true;
string url = "......";
client.DownloadStringCompleted += getRankingResult;
client.DownloadStringAsync(new Uri(url, UriKind.Absolute));
}
private void getRankingResult(object sender, DownloadStringCompletedEventArgs e)
{
.........
}
所以现在我可以向downloadCompleted事件添加一些参数了吗?就像是:
private void getRankingResult(object sender, DownloadStringCompletedEventArgs e, string Para)
{
.........
}
public void getRankingList(string country,string type)
{
WebClient client = new WebClient();
client.AllowReadStreamBuffering = true;
string url = "......";
client.DownloadStringCompleted += (sender, args) =>
getRankingResult(sender, args, "para");
client.DownloadStringAsync(new Uri(url, UriKind.Absolute));
}
private void getRankingResult(object sender, DownloadStringCompletedEventArgs e, string Para)
{
// .....
}
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句