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()); } } });
时间: 2024-10-21 18:22:40