Quantcast
Channel: All Forums
Viewing all articles
Browse latest Browse all 27852

How to config defaultdocs/mime/Scriptmaps by Microsoft.Web.Administration?

$
0
0

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?



Viewing all articles
Browse latest Browse all 27852

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>