本帖最后由 xiexieivy 于 2012-11-11 17:56:05 编辑

解决方案 »

  1.   

    也可以去试试System.Net.WebClient类,这个类简单一点、
      

  2.   

    public static string GetWebCode(string strURL, string strEncode)
    {
    HttpWebRequest request = (HttpWebRequest)WebRequest.Create(strURL);
    request.Method = "GET";
    WebResponse response = request.GetResponse();
    StreamReader sr = new StreamReader(response.GetResponseStream(), System.Text.Encoding.GetEncoding(strEncode));
    string content = sr.ReadToEnd();
    sr.Close();
    return content;