Const JAKARTA_ISAPI As String = "ISAPI-dll" Using serverManager As New ServerManager() Dim config As Configuration = serverManager.GetWebConfiguration(strWebsiteName, strVirtualDirName) Dim handlersSection As ConfigurationSection = config.GetSection("system.webServer/handlers") Dim handlersCollection As ConfigurationElementCollection = handlersSection.GetCollection() Dim addElement As ConfigurationElement = IISConfigurationSettings.FindElement(handlersCollection, "add", "name", JAKARTA_ISAPI) If addElement = Nothing Then Throw New InvalidOperationException("Element not found!") End If addElement("requireAccess") = "Execute" serverManager.CommitChanges() End Using
http://www.iis.net/ConfigReference/system.webServer/handlers
http://www.iis.net/ConfigReference/system.webServer/handlers/add