为你而来

aspnet企业级开发:iis5伪静态

首先下载一个实现伪静态的软件:isapi_rwl_0055.msi

然后在iis5服务器中,右键网站,点属性,选择筛选器,添加筛选器

指定以上软件安装目录下的\Helicon\ISAPI_Rewrite\ISAPI_Rewrite.dll

去掉这个目录下的httpd.ini文件只读属性

修改文件内容为

1 [ISAPI_Rewrite]
2 
3 RewriteRule /myasp/asp_([0-9,a-z,A-Z]*).html /myasp/test_style.aspx?id=$1

这样便完成了,在网址上输入http://localhost/myasp/asp_1341411aaaZZZ.html也就是调用了

http://localhost/myasp/test_style.aspx?id=1341411aaaZZZ

test_style.aspx:

 1 <%@ Page Language="C#" %>
 2 <%@ Import Namespace="System.Drawing" %>
 3 
 4 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
 5     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 6 
 7 <script runat="server">
 8     public string temp;
 9     protected void Page_Load(object sender, System.EventArgs e)
10     {
11         temp=Request["id"];
12      }  
13 </script>
14 
15 <html xmlns="http://www.w3.org/1999/xhtml" >
16 <head runat="server">
17     <title>Untitled Page</title>
18 </head>
19 <body>
20     <form id="form1" runat="server">
21     <div>
22 <font color="orange"><strong><%=temp%></strong></font>
23     </div>
24     </form>
25 </body>
26 </html>

 

posted on 2012-09-20 00:58  为你而来  阅读(378)  评论(0编辑  收藏  举报

导航