private void btnTest_Click(object sender, EventArgs e){
HttpWebRequest req = (HttpWebRequest)WebRequest.Create("http://bill.finance.sina.com.cn/bill/detail.php?stock_code=sh600000&bill_size=40000 ");
req.Method="GET";
HttpWebResponse rsp = (HttpWebResponse)req.GetResponse();
StreamReader rdr =new StreamReader(rsp.GetResponseStream(),Encoding.GetEncoding("GB2312"));
string s=rdr.ReadToEnd();
MessageBox.Show(s.Substring(0,1024));

}
取出来的结果是
------------------------------------------------------
<html><head>
<meta http-equiv="Content-type" content="text/html; charset=gb2312">
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="refresh" content="180">
<meta name="keywords" content="大单追踪">
<meta name="description" content="大单追踪">
<title>600000_大单明细_大单追踪_新浪财经</title><style type="text/css">
td,p,li,select,input,textarea {font-size:12px}
A IMG {border:0}
.img01{border:1px solid #999999}.f14 {font-size:14px}
.f12 {font-size:12px}.l15{line-height:150%}
.l13{line-height:130%}
.lh19{line-height:19px;}A:link {color:#0015EA}
A:hover {color:#ff0000;}A.sinatail:link,A.sinatail:visited {text-decoration:underline;color:#0000ff;font-size:12px}
A.sinatail:active,A.sinatail:hover {text-decoration:underline;color:#ff0000;font-size:12px}A.title1:link,A.title1:visited,A.title1:active,A.title1:hover {FONT-WEIGHT: bold; FONT-SIZE: 17px; COLOR: #000000; FONT-FAMILY: arial; TEXT-DECORATION: none;}
A.title2:link,A.title2:visited {COLOR: #000000; TEXT-DECORATION: none;}
A.title2:active,A.title2:hover {C
---------------------------
确定   
---------------------------

解决方案 »

  1.   

    不行啊,照抄你的代码
    出来的是
    輢麠]Wq嫦璇竔Vh{蒉颎K瓕,蓪&€Y栿`f鸵狠}諁璙wэ晞痧??\a虬別Y朵噇K贫0z8苿?d?......还是乱码!!!
      

  2.   

        public static string CatchData(string url)
        {
            WebClient _client = new WebClient();
            _client.BaseAddress = url;
            _client.Headers.Add("Accept", "image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-shockwave-flash, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, */*");
            _client.Headers.Add("Accept-Language", "zh-cn");
            _client.Headers.Add("UA-CPU", "x86");
            _client.Headers.Add("Accept-Encoding","gzip, deflate");
            _client.Headers.Add("User-Agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; SV1; .NET CLR 1.1.4322; .NET CLR 2.0.50727)");
            System.IO.Stream objStream = _client.OpenRead("/");
            System.IO.StreamReader _read = new System.IO.StreamReader(objStream, System.Text.Encoding.GetEncoding("GB2312"));        return _read.ReadToEnd();
        }
    用WebRequest来实现的话是乱码用这个方法来实现的话
    出来的就是这结果,不是我想要的
    <html>\n<head>\n<title>股票行情_财经纵横_新浪网</title>\n<meta http-equiv=\"Content-type\" content=\"text/html; charset=gb2312\">\n<script language=\"javascript\">\n<!--\nfunction onGoDetailClick()\n{\n\tvar country = document.getElementById(\"bill_country_id\").value;\n\tvar stock_code_value = document.getElementById(\"stock_code_id\").value;\n\tif (stock_code_value.length != 6)\n\t{\n\t\talert(\"请输入正确的6位股票代码,如600000\");\n\t}\n\telse\n\t{\n\t\tvar url = \"http://bill.finance.sina.com.cn/bill/detail.php?stock_code=\"+country+stock_code_value;\n\t\twindow.open(url,\"\",\"\");\n\t}\n}\n\nfunction onGoTradeItemClick()\n{\n\tvar country = document.getElementById(\"bill_country_id\").value;\n\tvar stock_code_value = document.getElementById(\"stock_code_id\").value;\n\tif (stock_code_value.length != 6)\n\t{\n\t\talert(\"请输入正确的6位股票代码,如600000\");\n\t}\n\telse\n\t{\n\t\tvar url = \"http://bill.finance.sina.com.cn/bill/trade_item.php?stock_code=\"+country+stock_code_value;\n\t\twindow.open(url,\"\",\"\");\n\t}\n}\n\nfunction onGo
    PriceStatistClick()\n{\n\tvar country = document.getElementById(\"bill_country_id\").value;\n\tvar stock_code_value = document.getElementById(\"stock_code_id\").value;\n\tif (stock_code_value.length != 6)\n\t{\n\t\talert(\"请输入正确的6位股票代码,如600000\");\n\t}\n\telse\n\t{\n\t\tvar url = \"http://bill.finance.sina.com.cn/bill/price_statist.php?stock_code=\"+country+stock_code_value;\n\t\twindow.open(url,\"\",\"\");\n\t}\n}\n\nfunction onGoHoldStatistClick()\n{\n\tvar country = document.getElementById(\"bill_country_id\").value;\n\tvar stock_code_value = document.getElementById(\"stock_code_id\").value;\n\tif (stock_code_value.length != 6)\n\t{\n\t\talert(\"请输入正确的6位股票代码,如600000\");\n\t}\n\telse\n\t{\n\t\tvar url = \"http://bill.finance.sina.com.cn/bill/hold_statist.php?stock_code=\"+country+stock_code_value;\n\t\twindow.open(url,\"\",\"\");\n\t}\n}\n//-->\n</script>\n</head>\n<body>\n<center>\n\n<br />\n\n<h1>\n<a href='http://bill.finance.sina.com.cn/bill/all.php' target='_blank'>实时大单</a> <a href='http://bill.finance.
    sina.com.cn/bill/analyse.php' target='_blank'>大单分析</a> <a href='http://bill.finance.sina.com.cn/bill/strange_bill.php' target='_blank'>异动大单</a> <a href='http://bill.finance.sina.com.cn/bill/history_all.php' target='_blank'>历史大单</a>\n</h1>\n\n交易所:<select id='bill_country_id'>\n<option value='sh'>上海</option>\n<option value='sz' selected>深圳</option>\n</select> 股票代码:<input type='text' id='stock_code_id' size='6' value='000001' onclick='this.value=\"\"'>\n<input type='button' value='大单明细' onclick='onGoDetailClick()'>\n<input type='button' value='成交明细' onclick='onGoTradeItemClick()'>\n<input type='button' value='分价表' onclick='onGoPriceStatistClick()'>\n<input type='button' value='持仓分析' onclick='onGoHoldStatistClick()'>\n\n<!--suggest begin-->\n<link rel=\"stylesheet\" href=\"http://finance.sina.com.cn/iframe/sg.css\">\n<script type=\"text/javascript\">\nfunction iask(fn){\n\tif(fn.q.value==\"\" || fn.q.value==\"代码/名称/拼音\")\n\t{\n\t\tfn.q.value=\"代码/名称/拼音\";\n\t\tfn.q.focus();\n\t\treturn false;\n\t}\n\tvar locadr=fn
    .locadr.value;\n\tif (locadr != \"\")\n\t{\n\t\twindow.open(locadr);\n\t}\n\telse\n\t{\n\t\tfn.symbol.value = fn.q.value;\n\t\tfn.submit();\n\t}\n\treturn false;\n}\nfunction g(URL){window.location.href=URL;}\n</script>\n<script language=\"text/javascript\">\nfunction String.prototype.xor(str)\n{\nvar result=\"\",l=Math.min(str.length,this.length);\nfor (var i=0;i<l;i++)result+=String.fromCharCode(this.charCodeAt(i)^str.charCodeAt(i));\nreturn result;\n}\nvar str1 = \"K6/1&=1Z  ^A  O  CYS@77;$57]\";\nvar str2=\"welcomezouyccrtaveagoodtimecc\";\n</script>\n<script language=javascript>\nvar recnum;\nvar reclist=new Array;\n</script>\n<form method=\"post\" id=\"f\" name=iask_f onSubmit=\"return iask(this)\" action=\"http://biz.finance.sina.com.cn/suggest/lookup.php\" target=_blank>\n\t<input type=\"text\" id=\"k\" name=\"q\" value=\"代码/名称/拼音\" size=\"35\" maxlength=\"50\" autocomplete=\"off\"  onClick=\"javascript:if(this.value=='代码/名称/拼音')this.value='';\">\n\t<input type=\"submit\" value=\"查询\" />\n\t<input name
    =\"s\" type=\"hidden\" value=\"1\">\n\t<input name=\"portnum\" id=\"portnum\" type=\"hidden\" value=\"8081\">\n\t<input type=\"hidden\" name=\"symbol\" id=\"symbol\">\n\t<input type=\"hidden\" name=\"et\" id=\"et\">\n\t<input type=\"hidden\" name=\"locadr\" id=\"locadr\">\n<script src=\"http://finance.sina.com.cn/iframe/za.js\"></script>\n<script language=javascript id=\"recscript\"></script>\n<script language=javascript>\neverytenms();\n</script>\n</form>\n<!--suggest end-->\n\n</center>\n</body>\n</html>\n\n
      

  3.   

    哦,差点忘记了……你注意检查一下 返回的HTTP头,看ContentType是不是 gzip压缩的如果是压缩的,你需要解压
      

  4.   

    给你一段代码……恩,只是片段,无法运行的
    private void _NavigateTo(object vURL) {
        _IsBusy = true;
        _URL=(string)vURL;
        HttpWebRequest Req = (HttpWebRequest)WebRequest.Create(_URL);
        Req.AllowAutoRedirect = true;
        Req.KeepAlive = true;
        Req.Method = "GET";
        Req.Accept = "*";
        Req.Referer = _Referer;
        Req.UserAgent = "Mozilla/4.0+(compatible;+MSIE+7.0;+Windows+NT+5.1;+eglic.com)";
        Req.Headers[HttpRequestHeader.Cookie] = Cookie;
        HttpWebResponse Rsp;
        try {
    Rsp = (HttpWebResponse)Req.GetResponse();
        } catch (Exception e) {
    _IsBusy = false;
    if (null != OnError) OnError(this, 4, e.Message);
    return;
        }
        _Headers = null;
        _Headers = Rsp.Headers.ToByteArray();
        //设置新的Cookie
        Cookie = Rsp.Headers[HttpResponseHeader.SetCookie];    if (HttpStatusCode.NotFound == Rsp.StatusCode) {
    _IsBusy = false;
    if (null != OnError) OnError(this, 2, "未找到网页");
    return;
        } else if (HttpStatusCode.InternalServerError == Rsp.StatusCode) {
    _IsBusy = false;
    if (null != OnError) OnError(this, 3, "服务器内部错误");
    return;
        }
        if (Rsp.Headers[HttpResponseHeader.ContentEncoding] == "gzip") {
    GZipStream stmz = new GZipStream(Rsp.GetResponseStream(), CompressionMode.Decompress);
    MemoryStream stmm = new MemoryStream();
    byte [] _zbuff = new byte[2048];
    int read = -1;
    read = stmz.Read(_zbuff, 0, 2048);
    while (read > 0) {
        stmm.Write(_zbuff, 0, read);
        read = stmz.Read(_zbuff, 0, 2048);
    }
    stmz.Close();
    stmz.Dispose();
    _HTML = Encoding.GetEncoding(_Lang).GetString(stmm.ToArray());
    stmm.Close();
    stmm.Dispose();
        } else {
    //设置编码
    StreamReader stm = new StreamReader(Rsp.GetResponseStream(), Encoding.GetEncoding(_Lang));
    _HTML = stm.ReadToEnd();
    stm.Dispose();
        }
        ParseHTML();
        _Referer = _URL;
        _IsBusy = false;
        if (null != OnDocumentReady) OnDocumentReady(this, false);
    }