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

烟台做网站需要多少钱网站开发公司运营流程

烟台做网站需要多少钱,网站开发公司运营流程,什么是网站的备案号,如何撤销网站上信息吗很多朋友可能都讨论过ASP.NET中生成HTML的方法了#xff0c;有按照模板用IO方法写文件 有在404错误页面内生成HTML的#xff0c;有在Render内保存页面输出到HTML文件的。 今天我发一个配合Url重写利用HttpHander手工编译.aspx页面方法。 HTML文件的方法#xff0c;可按需、“… 很多朋友可能都讨论过ASP.NET中生成HTML的方法了有按照模板用IO方法写文件 有在404错误页面内生成HTML的有在Render内保存页面输出到HTML文件的。 今天我发一个配合Url重写利用HttpHander手工编译.aspx页面方法。 HTML文件的方法可按需、“定时”的生成以减轻数据库的访问。 声明下面的文字是本文不可缺少的部分转载请保留谢谢作者武眉博活靶子.NET 同时首发于     落伍者    博客园       开发者学院   .Net男孩社区 知识点UrlRewrite、 IHttpModule、 IHttpHander 的编写 效果http://www.devedu.com/Doc/DotNet/AspNet/default.2.aspxhttp://www.devedu.com/Doc/DotNet/AspNet/default.2.html 思路 1 挂载“.aspx的请求到自定义的Httphander内 2 配置URL重写规则 3 访问某.aspx文件时在HttpHander内 根据配置确定是否应该生成  接着...  if(需要生成)  {   if(若已经生成html文件 )   {    if(文件并未过期)    {     则直接定向(Server.Transfer())。    }    else    {     删除HTML文件     重新编译.aspxPage内数据库操作等等     生成HTML文件    }   }   else if(尚未生成文件)   {    生成Html。   }  }  else  {   则编译.aspx文件  } 另建议阅读一下dudu的blog中关于asp.net页面编译的讨论http://www.cnblogs.com/dudu/archive/2006/03/07/345107.htmlhttp://www.cnblogs.com/dudu/archive/2006/03/07/344351.html 部分代码 C#代码 public void ProcessRequest(HttpContext context)           {               string rawUrl  context.Request.RawUrl;               string requestPath  context.Request.Path;               string applicationPath  context.Request.ApplicationPath;               Url urlItem  null;                 //上下文中没有定义ToStaticUrlItem表示此请求没有经过UrlRewrite,直接编译不生成html               //参考UrlRewriteModule.cs               if (context.Items[ToStaticUrlItem]  null)               {                   if (!File.Exists(context.Request.PhysicalPath))                   {                       throw new HttpException(404, 您访问的页面没有找到。);                   }                     // asp.net 1.1 采用下面方法编译页面                   //PageParser.GetCompiledPageInstance(requestPath, context.Request.PhysicalPath, context).ProcessRequest(context);                   IHttpHandler hander  BuildManager.CreateInstanceFromVirtualPath(requestPath, typeof(Page)) as IHttpHandler;                   hander.ProcessRequest(context);                     return;               }                 string filePath;                 urlItem  (Url)context.Items[ToStaticUrlItem];                 Regex regex  new Regex(                   Globals.ApplicationPath  urlItem.LookFor,                   RegexOptions.CultureInvariant | RegexOptions.Singleline | RegexOptions.Compiled | RegexOptions.IgnoreCase);                 string requestFile  regex.Replace(rawUrl, Globals.ApplicationPath  urlItem.WriteTo.Replace(^, ));                 if (requestFile.IndexOf(?)  0)               {                   filePath  requestFile.Substring(0, requestFile.IndexOf(?));               }               else              {                   filePath  requestFile;               }                 string inputFile  context.Request.PhysicalApplicationPath  filePath;               string path  context.Request.PhysicalApplicationPath  rawUrl.ToLower().Replace(.aspx, .html);               if (applicationPath ! /)               {                   inputFile  inputFile.Replace(applicationPath  /, \);                  path  path.Replace(applicationPath  /, ).Replace(/, \);              }              else              {                  path  path.Replace(/, \);              }               if (!urlItem.EnabledToStatic)              {                  // asp.net 1.1 采用下面方法编译页面                  //PageParser.GetCompiledPageInstance( filePath , inputFile , context ).ProcessRequest( context );                  IHttpHandler hander  BuildManager.CreateInstanceFromVirtualPath(filePath, typeof(Page)) as IHttpHandler;                  hander.ProcessRequest(context);                   return;              }               if (!File.Exists(path))              {                  // asp.net 1.1 采用下面方法编译页面                  //PageParser.GetCompiledPageInstance( filePath , inputFile , context ).ProcessRequest( context );                  IHttpHandler hander  BuildManager.CreateInstanceFromVirtualPath(filePath, typeof(Page)) as IHttpHandler;                  hander.ProcessRequest(context);                  context.Response.Filter  new AspxBoy.BuildHtmlDemo.ToHtmlFilter(context.Response.Filter, path);                   return;              }               if (urlItem.Minutes  Int32.MaxValue)              {                  context.Server.Transfer(rawUrl.ToLower().Replace(.aspx, .html));              }              else              {                  FileInfo fileInfo  new FileInfo(path);                  if (fileInfo.LastWriteTime.AddMinutes((double)urlItem.Minutes)  DateTime.Now)                  {                      fileInfo.Delete();                       // asp.net 1.1 采用下面方法编译页面                      //PageParser.GetCompiledPageInstance( filePath , inputFile , context ).ProcessRequest( context );                      IHttpHandler hander  BuildManager.CreateInstanceFromVirtualPath(filePath, typeof(Page)) as IHttpHandler;                      hander.ProcessRequest(context);                      context.Response.Filter  new AspxBoy.BuildHtmlDemo.ToHtmlFilter(context.Response.Filter, path);                  }                  else                  {                      context.Server.Transfer(rawUrl.ToLower().Replace(.aspx, .html));                   }                   return;               }           }   示例项目下载http://files.cnblogs.com/huobazi/BuildHtmlDemo.rar 转载于:https://www.cnblogs.com/huobazi/archive/2007/12/31/UrlRewriteAndHttpHanderAndMakeStaticHtmlFiles.html
http://www.pierceye.com/news/362769/

相关文章:

  • .php的网站是怎么做的最美情侣免费视频
  • v9网站模板学做西点的网站
  • 网站查询空间商工厂生产erp管理系统
  • 365房产南京网站响应式wordpress主题
  • 上海网站建设 app开发佛山黄页企业名录
  • 网站优化文档天津建设厅网站
  • 网站建设自适应网站电商网站运营规划
  • 做网站如何报价泰州建设局网站质监站
  • 做家具网站电影网站做流量吗
  • 免费1级做看网站制作单页网站要网址
  • 网站返回首页怎么做的好看自贡网站优化
  • 自己的网站如何做推广wordpress积分与奖励
  • 产品包装设计网站网站建设 中企动力宜昌
  • 英语营销型网站建设北京pk10网站开发
  • 交换链接适合哪些网站东莞小程序开发制作
  • 医院网站建设网站阿里巴巴网站是用什么技术做的
  • 潍坊 餐饮网站建设淘宝seo优化
  • 樟木头镇网站建设公司WordPress企业响应式主题
  • 怎么给网站做备份呢怎么去建设微信网站
  • 成都各公司网站中小企业网站建设 论文
  • 广告网站建设实训报告做电商从哪里入手
  • 建电子商务网站需要多少钱做网站的简称
  • 制定网站推广方案网络营销网站分析
  • 商城网站系网站 png逐行交错
  • 陕西网站建设陕icp备免费虚拟机安卓
  • 优化教程网站推广排名东莞网站建设推广有哪些
  • 金阳建设集团网站电子商务系统 网站建设
  • 网站建设规模哪里有做app软件开发
  • 建站工具上市手机视频网站设计
  • 代做道具网站做地方门户网站不备案可以吗