简体   繁体   English

在运行时在C#中添加和删除URL重写规则的明智方法?

[英]Smart way to add and remove URL rewrite rules in C# at runtime?

Some static URL rewrite section from my web.config: 我的web.config中的一些静态URL重写部分:

<rewrite>
   <rules>
      <rule name="Cities" stopProcessing="true">
        <match url="Cities/?$" ignoreCase="true" />
        <action type="Rewrite" url="/Cities.aspx" appendQueryString="true" />
      </rule>
   </rules>
</rewrite>

I works fine, but I would like to add dynamic rewrite rules at runtime. 我工作正常,但我想在运行时添加动态重写规则。 Is there a smart way to add and remove URL rewrite rules in C# at runtime? 有没有一种聪明的方法可以在运行时在C#中添加和删除URL重写规则?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM