日期:2014-05-17 浏览次数:20418 次
protected static string GetHttpData(string url) { StreamReader sr = null; string str = ""; try { WebRequest temp = WebRequest.Create(url); temp.Timeout = 1000; //读取 WebResponse myTemp = temp.GetResponse(); sr = new StreamReader(myTemp.GetResponseStream(), System.Text.Encoding.GetEncoding("gb2312")); str = sr.ReadToEnd(); } catch { return "-1"; } return str; }