利用IIS7自带类库管理IIS现在变的更强大更方便,而完全可以不需要用DirecotryEntry这个类了(网上很多.net管理iis6.0的文章都用到了DirecotryEntry这个类 ),Microsoft.Web.Administration.dll位于IIS的目录(%WinDir%\\System32\\InetSrv)下,使用时需要引用,它基本上可以管理IIS7的各项配置. 这个类库的主体结构如下: 主要调用code 如下: using (ServerManager sm = Ser…
How to Automate IIS 7 Configuration with .NET How to Automate IIS 7 Configuration with .NET Are you tired of manually configuring IIS sites (adding Web sites, application pools, virtual directories and so on)? Use C# and the Microsoft.Web.Administrat…
在使用DirectoryEntry操作IIS时,可以设置很多属性.但使用Microsoft.Web.Administration中的一些类时,不知道在哪设置.例如:AccessScript,AccessRead,目录浏览,匿名访问等属性.我现在写的代码如下: using(ServerManager sm = new ServerManager()) { ApplicationPool newPool = sm.ApplicationPools["NewPool"]; if (newPo…
http://blogs.msdn.com/b/carlosag/archive/2006/04/17/microsoftwebadministration.aspx 最好使用在IIS8中,因为为每一个application pool 都有自己独立的sandbox环境. 这些sandbox运行在不同的用户标识下,在进程层面限制这些程序所能占用的最大资源量,其中包括CPU使用率.…