There are Application,ApplicationPool,Site,Binding classes in ServerManager.So it's easy for us to configure website basic properties and application pool properties.
But I can't find any properties about defautdocs,mime,scriptmap and so on.
-----------
ServerManager iisManager = new ServerManager();
Configuration config = iisManager.GetWebConfiguration("mywebsite");
ConfigurationSection handlersSection = config.GetSection("system.webServer/handlers");
foreach (ConfigurationElement element in handlersSection.GetCollection())
{
MessageBox.Show(element.Attributes["Path"].Value + "\r\n\r\n" + element.Attributes["scriptProcessor"].Value);
}
---------
Though I can use Configuration class to get and set these properties,I don't think it's a good way,it is as same as changing the configration file.
Is there any better way?