Looks like you can use System.DirectoryServices.DirectoryEntries to read the IIS metabase. See here and here.
There is also a metabase.xml you can look at if you use IIS6.
elan
2009-08-05 23:31:48
Looks like you can use System.DirectoryServices.DirectoryEntries to read the IIS metabase. See here and here.
There is also a metabase.xml you can look at if you use IIS6.
This works for me on XP / IIS5.
adsutil.vbs GET W3SVC/1/ROOT/TestMPIService/KeyType
KeyType : (STRING) "IIsWebVirtualDir"
adsutil.vbs GET W3SVC/1/ROOT/aspnet_client/KeyType
KeyType : (STRING) "IIsWebDirectory"
More about the adsutil here: http://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/d3df4bc9-0954-459a-b5e6-7a8bc462960c.mspx?mfr=true