当前位置: 首页 > news >正文

网站建设企业网站建设wordpress徽章

网站建设企业网站建设,wordpress徽章,医院网站建设的要求,百度用户服务中心投诉电话页面静态化,有三种方式 伪静态 真静态,折中法 现在我做的是折中发 创建一个asp.net 页面, 连接跳转到还未生成的页面 创建HttpHandle类 using System;using System.Collections.Generic;using System.Linq;using System.Web;using System.IO;/// summary/// HttpHa…      页面静态化,有三种方式 伪静态  真静态,折中法  现在我做的是折中发 创建一个asp.net  页面,  连接跳转到还未生成的页面       创建HttpHandle类 using System;using System.Collections.Generic;using System.Linq;using System.Web;using System.IO;/// summary/// HttpHandle 的摘要说明/// /summarypublic class HttpHandle : IHttpHandler{ public bool IsReusable { get { return false; } } public void ProcessRequest(HttpContext context) { string url context.Request.RawUrl; int last url.LastIndexOf(_); int dot url.LastIndexOf(.); int NewNewsID int.Parse(url.Substring(last 1, dot - last - 1)); string carfilepath context.Server.MapPath(~/new/newNews_ NewNewsID .html); if (!File.Exists(carfilepath)) { NewNews NN new NewNews(); Listpush NewNe NN.NewNe; string templatepath context.Server.MapPath(~/new/HtmlPage.html); string templateHtml ReadTemplate(templatepath); templateHtml templateHtml.Replace({$NewNewsName}, NewNe[NewNewsID].NewNewsName); templateHtml templateHtml.Replace({$NewNewsTitle}, NewNe[NewNewsID].NewNewsTitle); templateHtml templateHtml.Replace({$NewNewsConters}, NewNe[NewNewsID].NewNewsConters); WriteHtmlFile(carfilepath, templateHtml); } context.Response.WriteFile(carfilepath); } // private string ReadTemplate(string templatePath) //{ // //检测模板文件是否存在 // if (!File.Exists(templatePath)) // { // //模板文件不存在抛出异常 // throw new Exception(汽车详情页面的模板文件未找到); // } // //创建文件流 // FileStream fs new FileStream(templatePath, FileMode.Open); // //创建流读取器 // StreamReader sr new StreamReader(fs); // //读取文件流中的文本 // string templeteHtml sr.ReadToEnd(); // //关闭流读取器 // sr.Close(); // //关闭文件流 // fs.Close(); // //返回读取的模板HTML // return templeteHtml; //} 写静态文件 //private void WriteHtmlFile(string savedPath, string htmlStr) //{ // FileStream fs new FileStream(savedPath, FileMode.Create); // StreamWriter sw new StreamWriter(fs); // sw.Write(htmlStr); // sw.Close(); // fs.Close(); //} //读取模板方法 private string ReadTemplate(string templatePath) { if (!File.Exists(templatePath)) { throw new Exception(报错); } FileStream fs new FileStream(templatePath, FileMode.Open); StreamReader sr new StreamReader(fs); string templeteHtml sr.ReadToEnd(); sr.Close(); fs.Close(); return templeteHtml; } // private void WriteHtmlFile(string savedPath, string htmlStr) { FileStream fs new FileStream(savedPath, FileMode.Create); StreamWriter sw new StreamWriter(fs); sw.Write(htmlStr); sw.Close(); fs.Close(); } }     创建一个   NewNews  表示服务器 添加数据   public Listpush NewNe new Listpush(); public NewNews() { NewNe.Add(new push() { NewNewsID 0, NewNewsName 今天是2018/5/30, NewNewsTitle 今天下雨了, NewNewsConters 圆周 }); NewNe.Add(new push() { NewNewsID 1, NewNewsName 今天下雨了嘛是, NewNewsTitle 今天下雨了, NewNewsConters 32 }); NewNe.Add(new push() { NewNewsID 2, NewNewsName 今天是2018/5/30, NewNewsTitle 今天下雨了, NewNewsConters 烦烦烦烦烦烦22342 }); NewNe.Add(new push() { NewNewsID 3, NewNewsName 今天是2018/5/30, NewNewsTitle 今天下雨了, NewNewsConters 2342 }); }}   创建一个push 类  添加属性字段 /// summary/// push 的摘要说明/// /summarypublic class push{ public int NewNewsID { get; set; } public string NewNewsName { get; set; } public string NewNewsTitle { get; set; } public string NewNewsConters { get; set; }}       新建一个html页面  .为模板 !DOCTYPE htmlhtml xmlnshttp://www.w3.org/1999/xhtmlhead meta http-equivContent-Type contenttext/html; charsetutf-8 / title表格/title/headbody div p{$NewNewsName}/p p{$NewNewsConters}/p p{$NewNewsTitle}/p /div /body/html   这样子 就可以了转载于:https://www.cnblogs.com/whatarey/p/9112493.html
http://www.pierceye.com/news/913796/

相关文章:

  • 网站建设免费的服务器商丘推广公司
  • 网站设计大概价格设计网络平台的公司
  • phpcms中的网站介绍页中文去掉wordpress
  • 网站的建设心得怎么做网站淘宝转换工具
  • 做网站1天转多钱wordpress 分享插件
  • 淘宝网站建设单子好接吗朝阳区办公
  • html5网站建设平台怎么给网站添加图标
  • 中文域名网站网站制作wap页面
  • wordpress站内全文检索一个人完成网站建设
  • wordpress自定义重用结构北京seo怎么优化
  • 苏州做网站专业的公司vs2008怎么做网站
  • 效果好的徐州网站建设休闲食品网站建设策划书
  • 如何发布自己的网站wordpress 4.9.6 下载
  • 织梦网站打开慢企业咨询师资格证
  • 蓬莱网站建设哪家好广州白云网站建设
  • 网站建设得花多少钱做购物网站能否生存
  • 多语言网站 用什么cms深圳Wordpress网站
  • 常州市建设工程质量监督站网站开发公司设计管理岗位述职
  • 国外网站顶部菜单设计谷歌seo文章
  • 梅州网站开发外国自适应企业网站
  • 大型网站建设动力无限哪个公司的装饰设计公司
  • 网站建设与管理自考wordpress替换默认的编辑器
  • 企业在网站推广咸阳做网站开发公司
  • 从美洲开始做皇帝免费阅读网站wordpress嵌入优酷视频播放
  • 长沙 外贸网站建设国际足联世界排名
  • 辽宁省建设执业继续教育协会网站深圳网站制作建设服务公司
  • 个人网站备案都需要什么运营seo是什么意思
  • 局域网内部网站建设app下载苏州网络推广企业
  • 重庆美邦 网站建设保定最新消息发布
  • 东莞手机建网站旅游网站 分析