通过WebClient来获取网络内容
Thread t = new Thread(new ThreadStart(ProcessWeb));
t.Start();
private void ProcessWeb()
{
WebClient wc = new WebClient();
wc.OpenReadCompleted += wcOpenReadCompleted;
wc.OpenReadAsync(new Uri("http://www.oschina.net/wp7"));
}
private void wcOpenReadCompleted(object sender, OpenReadCompletedEventArgs args)
{
if (!args.Cancelled && args.Error == null)
{
args.Result ; //这里保存着二进制结果。
}
}
浙公网安备 33010602011771号