Change URL Rewrite Rule in Web.Config from Code C#

后端 未结 3 1918
轮回少年
轮回少年 2021-01-02 08:49

I want to modify rewrite rule from C# code. Url Rewrite rule is resides in web.config file.


    
               


        
3条回答
  •  青春惊慌失措
    2021-01-02 09:30

    Microsoft has Microsoft.Web.Administration.dll available to help you out, but it requires administrator permissions to execute,

    https://www.iis.net/learn/manage/scripting/how-to-use-microsoftwebadministration

    It is quite suitable for a WinForms application (such as IIS Manager) to control an IIS server, but can also be used in other types of applications.

    I do have a personal project that is a custom MWA implementation that works for some non-administrator cases. If you are interested in it, let me know.

提交回复
热议问题