I need block a huge IP list via config file
c:\Windows\system32\inetsrv\config\applicationHost.config
change the configuration for the web server:
from:
< section name="ipSecurity" overrideModeDefault="Deny" / >
to:
< section name="ipSecurity" overrideModeDefault="Allow" / >
and your web.config
< configuration >
< system.webServer >
< security >
< ipSecurity configSource="fileWithIps.config" / >
< /security >
< /system.webServer >
< /configuration >
There are multiple ways you could achieve this, but for a start I would look at the ConfigurationManager's ConfigurationManager.OpenMappedExeConfiguration method for mapping a secondary config file