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;
            } 

  • 相关阅读:
    实验2:Mininet实验——拓扑的命令脚本生成
    实验1:Mininet源码安装和可视化拓扑工具
    第一次博客作业
    数据采集第四次作业
    第7组(69)团队展示
    数据采集第三次作业
    结对作业
    数据采集第二次作业
    数据采集第一次作业
    第一次个人编程作业
  • 原文地址:https://www.cnblogs.com/rr163/p/4011540.html
Copyright © 2011-2022 走看看