using System; using System.Collections.Generic; using System.Text; using System.Configuration; using System.Net; using System.IO; public static class Employees { static string Service_Url = "http://www.baidu.com"; public static string Get_Http() { WebClient client = new WebClient(); HttpWebRequest Request = (HttpWebRequest)HttpWebRequest.Create(Service_Url); HttpWebResponse myResponse = (HttpWebResponse)Request.GetResponse(); Stream myStream = myResponse.GetResponseStream(); using (StreamReader reader = new StreamReader(myStream, Encoding.UTF8)) { return reader.ReadToEnd(); } } }