How can I configure IIS 6 programmatically?
I see that there is a nice library Microsoft.Web.Administration
that allows you to co开发者_如何转开发nfigure IIS 7. It appears that Microsoft.Web.Administration
doesn't work for IIS6, so I am trying to see if someone can provide some alternative suggestions.
I am building a Windows Form Application that will allow you to implement all the properties required to configure (Website, Virtual directories, Application pools...etc).
To configure IIS6 you will have to revert to the System.Directory services.
string iisPath = "IIS://localhost/W3svc/1/Root";
DirectoryEntry IISRootEntry = new DirectoryEntry(iisPath);
and take it from there.
Hope this helps,
There is a massive VB script called ADSUtil.vbs that lives in IIS's admin directory that can be used to configure IIS in a scripted, if not programmatic, way. You could either call out to it, or read it and rip off its internals.
精彩评论