使用HttpWebRequest抓取网页

        HttpWebRequest Wr = (HttpWebRequest)WebRequest.Create(http://www.rzhh.com.cn/default.html);
        HttpWebResponse response = (HttpWebResponse)Wr.GetResponse();
        Stream receiveStream = response.GetResponseStream();
        StreamReader readStream = new StreamReader(receiveStream, Encoding.Default);
        Label1.InnerHtml  = readStream.ReadToEnd();

        response.Close();
        readStream.Close();

//然后可以用正则表达式分离需要的内容

 

你可能感兴趣的:(request)