private void button1_Click(object sender, EventArgs e)
{
HttpWebRequest rq = (HttpWebRequest)WebRequest.Create("http://www.google.com");
rq.Method = "GET";
rq.Referer = "http://www.baidu.com";
HttpWebResponse rp=(HttpWebResponse)rq.GetResponse();
Stream st = rp.GetResponseStream();
StreamReader sr = new StreamReader(st,Encoding.UTF8);
textBox1.Text = sr.ReadToEnd();
}
<b class=gb1>�Ҧ����</b> <a href="http://www.google.com.hk/imghp?hl=zh-tw&tab=wi" onclick=gbar.qs(this) class=gb1>�Ϥ�</a> <a 读出来后会有框框?GOOGLE确实是UTF-8编码啊!
{
HttpWebRequest rq = (HttpWebRequest)WebRequest.Create("http://www.google.com");
rq.Method = "GET";
rq.Referer = "http://www.baidu.com";
HttpWebResponse rp=(HttpWebResponse)rq.GetResponse();
Stream st = rp.GetResponseStream();
StreamReader sr = new StreamReader(st,Encoding.UTF8);
textBox1.Text = sr.ReadToEnd();
}
<b class=gb1>�Ҧ����</b> <a href="http://www.google.com.hk/imghp?hl=zh-tw&tab=wi" onclick=gbar.qs(this) class=gb1>�Ϥ�</a> <a 读出来后会有框框?GOOGLE确实是UTF-8编码啊!
Encoding.UTF8
改成
Encoding.Default
试试
如果不行
Encoding.Gb2312