1.使用serever.Excute
StreamWriter sw = new StreamWriter(Server.MapPath("html/Login.html"), false);
Server.Execute("ShowColumn.aspx?id=1&page=2", sw);
sw.Close();
2.替换字符
url重写
1.定义重写规则
urls.xml 变成urls.config
<?xml version="1.0" encoding="utf-8" ?>
<Urls>
<rewrite name="ShowArticle" pattern="article-(\d+).html" path ="article-{0}.html" page="showarticle.aspx" query="id=$1"></rewrite>
<rewrite name="ShowList" pattern="list-(\d+).html" path ="list-{0}.html" page="showlist.aspx" query="id=$1"></rewrite>
</Urls>
2.创建一个简单的实体urls类
3.urls类 获取urls.config文件中的所有url
4.httpmodule类处理 请求的地址
5.在web.config httpmodule节点添加