/// <summary> /// 获取URL内容 /// </summary> /// <param name="Url"></param> /// <returns></returns> public string HttpGet(string Url) { HttpWebRequest request = (HttpWebRequest )WebRequest.Create(Url); request.Method = "GET"; request.ContentType = "text/html;charset=UTF-8" ; HttpWebResponse response = (HttpWebResponse )request.GetResponse(); Stream myResponseStream = response.GetResponseStream(); StreamReader myStreamReader = new StreamReader(myResponseStream, Encoding.GetEncoding("utf-8" )); string retString = myStreamReader.ReadToEnd(); myStreamReader.Close(); myResponseStream.Close(); return retString; }