如何通过C#更改IIS中的应用程序设置 [英] How to change settings of an application in IIS through C#

查看:262
本文介绍了如何通过C#更改IIS中的应用程序设置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在IIS7的默认网站中部署了一个应用程序。要更改我的应用程序的设置,我必须右键单击该应用程序,转到管理应用程序,然后单击高级设置。弹出一个窗口。在该窗口中,在行为部分中,默认情况下启用协议设置为 http

I have deployed an application in Default Website of IIS7. To make changes to settings of my application, I have to right click the application, go to Manage Application, and click Advance Settings. A window pops up. In that window, in Behavior section, there is "Enabled protocols" which is set to "http" by default.

我想通过 C#代码将启用协议的值从http更改为 http,net.tcp

I want to change the value of Enable protocols from http to http,net.tcp through C# code.

推荐答案

我之前必须做类似的事情。我使用的一个很好的资源是: http:/ /patelshailesh.com/index.php/create-a-website-application-pool-programmatically-using-csharp 还有: http://www.codersource.net/2010/02/02/iis-metabase-and-programmatic-administration -in -c /

I had to do something similar to this before. One great resource I used was: http://patelshailesh.com/index.php/create-a-website-application-pool-programmatically-using-csharp and also this: http://www.codersource.net/2010/02/02/iis-metabase-and-programmatic-administration-in-c/

在这2篇文章中,您应该能够以编程方式执行任何类型的IIS管理。希望这有帮助!

Between the 2 articles, you should be able to do any kind of IIS administration programmically. Hope this helps!

这篇关于如何通过C#更改IIS中的应用程序设置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆