zoukankan      html  css  js  c++  java
  • 简单的单页c#生成静态页源码

    protected void BtGroup_ServerClick(object sender, EventArgs e)
            {
                //产业群首页
                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;
            }
  • 相关阅读:
    努力的意义是什么?
    那些成功学和鸡汤文没有告诉你的
    曾国藩:一勤天下无难事
    王健林台大演讲:谁没有艰辛的过往?
    什么样的能量才能支撑一个人走过人生的低谷和迷茫
    想成为大树,就不要和草去比
    马云:不吃苦,你要青春干嘛?
    微博运营要点
    numba学习教程
    机器学习的分类
  • 原文地址:https://www.cnblogs.com/bestsaler/p/1835728.html
Copyright © 2011-2022 走看看