大型网站新闻系统如何生成静态网页
2006-12-30 16:10
435 查看
大型网站的新闻系统 一般都是以静态html文件的形式出现,这样做的好处就是对搜索引擎友好,能保证搜索引擎有效地收录网站内容.
下面我提出两种解决办法,首先看看微软的解决办法.
方法一:微软的解决办法:
Thisstep-by-steparticledescribeshowtoretrievetheHTMLresultsofapageasastreamandthendownloadthestreamtoafile.WhenyouusetheFileStreamobjectandsettheResponse.FilterpropertytotheFileStreamobject,allHTTPoutputthatResponse.Writesendsalsodownloadsasstreamtoafile.
方法二:我的解决办法:
下面我提出两种解决办法,首先看看微软的解决办法.
方法一:微软的解决办法:
Thisstep-by-steparticledescribeshowtoretrievetheHTMLresultsofapageasastreamandthendownloadthestreamtoafile.WhenyouusetheFileStreamobjectandsettheResponse.FilterpropertytotheFileStreamobject,allHTTPoutputthatResponse.Writesendsalsodownloadsasstreamtoafile.
CreateaWebForm
TocreateaWebForm:1. | InVisualC#.NET,createanewASP.NETWebApplicationprojectnamedASPNETFilter. |
2. | Right-clickthedesignerpaneofWebForm1.aspx. |
3. | ClickViewHTMLSourcetoedittheHTMLcode. |
4. | Replacetheexistingcodewiththefollowingcode: |
CreatetheResponseFilterClass
TocreatetheResponseFilterclass:1. | AddanewclassnamedResponseFilter.cs. | ||||
2. | Replacetheexistingcodewiththefollowingcode: NoteBeforeyouruntheWebapplication:
|
UsetheResponseFilterClass
1. | InSolutionExplorer,selectWebForm1.aspx. |
2. | Right-clickandthenselectViewCode. |
3. | AddthefollowingcodetotheOnIniteventcode: |
TesttheResponseFilter
1. | SavethechangestotheASPNETFilterWebproject. |
2. | OntheBuildmenu,selectBuildSolution. |
3. | StartMicrosoftInternetExplorer,andthenopenWebForm1.aspxbyspecifyingthefollowingURL,whereIISServerNameisthenameofyourMicrosoftInternetInformationServices(IIS)server: |
4. | FindtheResponse.htmfileintheC:/FilterOutputfolder. |
相关文章推荐
- 阅读《大型网站技术架构》第五、六、七章,结合我们的系统,分析如何增加相应的功能,提高系统的可用性和易用性。
- 阅读《大型网站技术架构》第五、六、七章感想,如何提高系统的可用性和易用性。
- 讨论加求教如何配置大型网站的硬件及软件系统
- 大型网站系统架构实践(三)如何提高网站的高可用和高性能
- 资深架构师如何看待大型网站系统架构
- 如何逐步去构建一个大型网站系统
- 如何逐步去构建一个大型网站系统
- 如何搭建大型网站系统
- 如何逐步去构建一个大型网站系统 3ff8
- 大型网站系统架构实践(三)如何提高网站的高可用和高性能
- 看看腾讯和百度等这样的大型网站系统架构是如何演化的
- 资深架构师,讲述大型网站的系统架构演变过程
- 说说大型高并发高负载网站的系统架构
- 大型高并发高负载网站的系统架构
- 大型网站系统架构演化之路
- VS2008发布、生成网站时如何像vs2003那样生成单个dll文件
- 运行效率高稳定性好的大型网站系统架构分析
- 大型网站系统架构分析
- 高并发高负载的大型网站系统架构
- 大型网站采用什么系统架构保证性能稳定性