码迷,mamicode.com
首页 > 其他好文 > 详细

ThreadPool.QueueUserWorkItem

时间:2015-12-05 21:04:29      阅读:180      评论:0      收藏:0      [点我收藏+]

标签:

ThreadPool.QueueUserWorkItem(_ =>
{
HttpWebRequest request = (HttpWebRequest)WebRequest.Create("http://www.baidu/tag/模特?page=" + pageNum);
request.Credentials = System.Net.CredentialCache.DefaultCredentials;
HttpWebResponse response = (HttpWebResponse)request.GetResponse();
if (response.StatusCode == HttpStatusCode.OK)
{
using (StreamReader sr = new StreamReader(response.GetResponseStream()))
{
List<Uri> links = FetchLinksFromSource(sr.ReadToEnd());

}
}
});

  

ThreadPool.QueueUserWorkItem

标签:

原文地址:http://www.cnblogs.com/hbsfgl/p/5022228.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!