在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
{ //产业群首页 string tempGroupData = GetHttpData("http://www.goudiannao.com/Group/index.aspx"); using (StreamWriter sw = new StreamWriter(this.Request.PhysicalApplicationPath + "Group\\Index.html", false, System.Text.Encoding.GetEncoding("utf-8"))) { sw.Write(tempGroupData); sw.Flush(); } } public string GetHttpData(string sUrl) { string sRslt = null; WebResponse oWebRps = null; WebRequest oWebRqst = WebRequest.Create(sUrl); oWebRqst.Timeout = 50000; try { oWebRps = oWebRqst.GetResponse(); } finally { if (oWebRps != null) { StreamReader oStreamRd = new StreamReader(oWebRps.GetResponseStream(), System.Text.Encoding.GetEncoding("utf-8")); sRslt = oStreamRd.ReadToEnd(); oStreamRd.Close(); oWebRps.Close(); } } return sRslt; } |
请发表评论