////// 默认的编码:UTF8 /// public Encoding _encoding = Encoding.UTF8; ////// 返回Html /// public string returnHtmlData = ""; ////// 返回错误信息 /// public string returnErrorData = ""; private string _url; ////// 生成html /// private void GetHttpRequestString() { try { System.Net.WebRequest wReq = System.Net.WebRequest.Create(_url); System.Net.WebResponse wResp = wReq.GetResponse(); System.IO.Stream respStream = wResp.GetResponseStream(); System.IO.StreamReader reader = new System.IO.StreamReader(respStream, _encoding); returnHtmlData = reader.ReadToEnd(); } catch (System.Exception ex) { returnErrorData += ex.Message; } }