下载某个网站的内容

WebRequest req = WebRequest.Create("http://www.123cha.com/ip/?q=15804888888");          
            WebResponse result = req.GetResponse();
            Stream ReceiveStream = result.GetResponseStream();
            StreamReader readerOfStream = new StreamReader(ReceiveStream,System.Text.Encoding.GetEncoding("UTF-8"));
            string aa = readerOfStream.ReadToEnd();
            aa = aa.Remove(0,aa.IndexOf("[其他参考数据]: "));
            aa = aa.Remove(aa.IndexOf("[查询提供]"));
            aa = aa.Remove(0, 10);
            aa = aa.ToLower();
            aa = aa.Remove(aa.IndexOf("<br>"));
            this.textBox1.Text = aa;
            ReceiveStream.Close();

posted @ 2011-07-18 13:01  徐一贺  阅读(349)  评论(0编辑  收藏  举报