网络映射的概念 ASP.NET中实现访问链接的静态地址映射
ASP.NET中实现访问链接的静态地址映射
protected void Application_BeginRequest(Object sender EventArgs e) { string strCurrentPath; strCurrentPath = Request Path; //make sure that it ends with aspx This is some quick validation on the path //This will shortcut processing for images and other files (WebResource axd for example) if(System IO Path GetExtension(strCurrentPath) EndsWith( aspx true System Globalization CultureInfo InvariantCulture)) { string strCustomPath; string qString = Request QueryString ToString(); if(qString != string Empty) qString = & + qString; strCurrentPath = strCurrentPath ToLowerInvariant(); string appRoot = GetAppRoot(strCurrentPath); //string pageName = ; // the URL contains this folder name //Response Write(strCurrentPath); if(strCurrentPath IndexOf( catalog/ StringComparison InvariantCultureIgnoreCase) > ) {

appRoot = appRoot Replace( catalog/ ); strCustomPath = appRoot + catalog aspx?guid= + System IO Path GetFileNameWithoutExtension(strCurrentPath) + qString;
// rewrite the URL Context RewritePath(strCustomPath false); } else if(strCurrentPath IndexOf( product/ StringComparison InvariantCultureIgnoreCase) > ) { appRoot = appRoot Replace( product/ );
strCustomPath = appRoot + product aspx?guid= + System IO Path GetFileNameWithoutExtension(strCurrentPath); // rewrite the URL
lishixinzhi/Article/program/net/201311/13825相关文章
- 什么是网络的体系结构 ASP.NET入门教程 6.1 Web服务器体系结构[1]
- aspnet可以做前端吗 asp.net用三种方法检测远程URL存在与否
- aspnet网站开发教程 ASP.NET Routing对请求的处理方法
- aspnet网站开发教程 ASP.NET之Gridview图解
- aspnet项目开发教程 ASP.NET入门教程 12.2.2 传送Web服务[1]
- 什么是网络的体系结构 ASP.NET入门教程 6.1 Web服务器体系结构[2]
- access数据表视图显示标题 ASP.NET WEB视图标题截字功能实现
- wenet网址 Asp.net 页面导航的几种方法与比较
- aspnet项目开发教程 ASP.NET入门教程 12.2.2 传送Web服务[3]
- aspnet项目开发教程 ASP.NET+XML打造网络硬盘
爱学记

微信收款码
支付宝收款码