在C#中将参数传递给DownloadStringCompletedEventHandler

时间:2010-10-29 01:30:34

标签: c# windows-phone-7 event-handling

我正在研究WP7中的应用程序,我想将一个列表框作为参数传递给client_DownloadStringCompleted方法。

我的代码如下所示,

WebClient client = new WebClient();
client.DownloadStringCompleted += new DownloadStringCompletedEventHandler(client_DownloadStringCompleted);

1 个答案:

答案 0 :(得分:7)

只需将此行添加到您的代码中:

client.DownloadStringAsync(yourUri, yourListBox);