public string GetContent(string url)
{
HttpWebRequest req =(HttpWebRequest)WebRequest.Create(url);
//req.
HttpWebResponse res = (HttpWebResponse)req.GetResponse();
StreamReader sr = new StreamReader(res.GetResponseStream(),System.Text.Encoding.GetEncoding("gb2312"));
string content = sr.ReadToEnd();
//Response.Write(content);
return content;
}
private void btSearch_Click(object sender, System.EventArgs e)
{
string url = this.TbUrl.Text.Trim();
this.tbContent.Text=this.GetContent(url);
}