0
我想在我的web.config文件中訪問system.webServer/defaultDocument
,但似乎無法找到如何。我已經嘗試了各種關於編輯Web配置文件的文章,但我似乎沒有相同的選項來訪問system.webServer
中的項目,就像我更改connectionString時一樣。如何以編程方式更改web.config中的system.webServer/defaultDocument
我可以使用加載system.webServer部分:
ConfigurationSection WebServerSection = (ConfigurationSection)WebConfigurationManager.GetSection("system.webServer");
,但不能看到找到任何東西從該點可使用。我注意到的一件事是system.webServer
部分的類型是System.Configuration.IgnoreSection
。這是否阻止我有權編輯它?
我似乎無法找到Microsoft.Web.Administration命名空間中使用我的網站。它位於哪裏? – webnoob
沒關係,我在'%windir%\ syswow64 \ inetsrv'中發現它。我也在看這篇文章,它似乎與此DLL一致。 http://blogs.msdn.com/b/saurabh_singh/archive/2007/11/24/accessing-iis-7-0-features-programmatically-from-configuration-file-s-c.aspx謝謝。 – webnoob