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

相关文章:

  • 2022-12-23
  • 2021-11-15
  • 2021-10-30
  • 2022-12-23
  • 2021-11-17
  • 2021-12-02
  • 2021-06-23
  • 2021-08-06
猜你喜欢
  • 2021-10-11
  • 2021-08-19
  • 2022-12-23
  • 2021-09-05
  • 2021-10-12
  • 2022-02-22
  • 2021-07-27
相关资源
相似解决方案