调用IIS接口自动拉黑IP的代码: import dotNet; var appDomain = dotNet.clr().createAppDomain(); var serverManager = appDomain.load("Microsoft.Web.Administration").createInstance("ServerManager"); var config = serverManager.GetApplicationHostConfiguration(); var ipSecuritySection = config.GetSection("system.webServer/security/ipSecurity","bbs.aardio.com"); var ipSecurityCollection = ipSecuritySection.GetCollection(); var addElement = ipSecurityCollection.CreateElement("add"); addElement.Item["ipAddress"] = "197.197.197.197"; addElement.Item["subnetMask"] = "255.255.255.255"; addElement.Item["allowed"] = false; ipSecurityCollection.Add(addElement); serverManager.CommitChanges();