DirectoryEntry root = new DirectoryEntry(@"IIS://localhost/W3SVC"); string PInfo = ""; foreach (string elmentName in root.Properties.PropertyNames) { PropertyValueCollection valueCollection = root.Properties[elmentName]; for (int i = 0; i < valueCollection.Count; i++) { PInfo += elmentName + "[ " + i.ToString() + "] = " + valueCollection[i].ToString() + " "; } }
PInfo的结果是:
KeyType[ 0] = IIsWebService
SslUseDsMapper[ 0] = False
LogFileDirectory[ 0] = C:inetpublogsLogFiles
LogPluginClsid[ 0] = {FF160663-DE82-11CF-BC0A-00AA006111E0}
AppPoolId[ 0] = DefaultAppPool
IIs5IsolationModeEnabled[ 0] = False
DontLog[ 0] = False
DirBrowseFlags[ 0] = 1073741854
DefaultDoc[ 0] = Index.aspx,Default.htm,Default.asp,index.htm,index.html,iisstart.htm,default.aspx
AuthFlags[ 0] = 1
AnonymousUserName[ 0] = IUSR
AspDiskTemplateCacheDirectory[ 0] = C:inetpub empASP Compiled Templates
HttpErrors[ 0] = 401,*,FILE,C:inetpubcusterrzh-CN401.htm
HttpErrors[ 1] = 403,*,FILE,C:inetpubcusterrzh-CN403.htm
HttpErrors[ 2] = 404,*,FILE,C:inetpubcusterrzh-CN404.htm
HttpErrors[ 3] = 405,*,FILE,C:inetpubcusterrzh-CN405.htm
HttpErrors[ 4] = 406,*,FILE,C:inetpubcusterrzh-CN406.htm
HttpErrors[ 5] = 412,*,FILE,C:inetpubcusterrzh-CN412.htm
HttpErrors[ 6] = 500,*,FILE,C:inetpubcusterrzh-CN500.htm
HttpErrors[ 7] = 501,*,FILE,C:inetpubcusterrzh-CN501.htm
HttpErrors[ 8] = 502,*,FILE,C:inetpubcusterrzh-CN502.htm
SSIExecDisable[ 0] = False
AccessSSLFlags[ 0] = 0
NTAuthenticationProviders[ 0] = Negotiate,NTLM
WebSvcExtRestrictionList[ 0] = 0,*.exe
WebSvcExtRestrictionList[ 1] = 0,*.dll
WebSvcExtRestrictionList[ 2] = 1,C:WindowsMicrosoft.NETFrameworkv4.0.30319aspnet_isapi.dll,1,ASP.NET v4.0.30319,ASP.NET v4.0.30319
WebSvcExtRestrictionList[ 3] = 1,C:WindowsMicrosoft.NETFramework64v4.0.30319aspnet_isapi.dll,1,ASP.NET v4.0.30319,ASP.NET v4.0.30319
WebSvcExtRestrictionList[ 4] = 1,C:Windowssystem32inetsrvasp.dll,1,ASP,Active Server Pages
WebSvcExtRestrictionList[ 5] = 1,C:Program FilesCommon FilesMicrosoft SharedWeb Server Extensions12isapi\_vti_autauthor.dll,1,Windows SharePoint Services V3,Windows SharePoint Services V3
WebSvcExtRestrictionList[ 6] = 1,C:Program FilesCommon FilesMicrosoft SharedWeb Server Extensions12isapi\_vti_admadmin.dll,1,Windows SharePoint Services V3,Windows SharePoint Services V3
WebSvcExtRestrictionList[ 7] = 1,C:Program FilesCommon FilesMicrosoft SharedWeb Server Extensions12isapishtml.dll,1,Windows SharePoint Services V3,Windows SharePoint Services V3
WebSvcExtRestrictionList[ 8] = 1,C:Program FilesCommon FilesMicrosoft SharedWeb Server Extensions12isapiowssvr.dll,1,Windows SharePoint Services V3,Windows SharePoint Services V3
WebSvcExtRestrictionList[ 9] = 1,C:WindowsMicrosoft.NETFrameworkv2.0.50727aspnet_isapi.dll,1,ASP.NET v2.0.50727,ASP.NET v2.0.50727
AccessFlags[ 0] = 513
ScriptMaps[ 0] = .rules,C:WindowsMicrosoft.NETFrameworkv2.0.50727aspnet_isapi.dll,1
ScriptMaps[ 1] = .xoml,C:WindowsMicrosoft.NETFrameworkv2.0.50727aspnet_isapi.dll,1
ScriptMaps[ 2] = .asp,C:Windowssystem32inetsrvasp.dll,5,GET,HEAD,POST
ScriptMaps[ 3] = .cer,C:Windowssystem32inetsrvasp.dll,5,GET,HEAD,POST
ScriptMaps[ 4] = .axd,C:WindowsMicrosoft.NETFrameworkv4.0.30319aspnet_isapi.dll,1,GET,HEAD,POST,DEBUG
ScriptMaps[ 5] = .aspx,C:WindowsMicrosoft.NETFrameworkv4.0.30319aspnet_isapi.dll,1,GET,HEAD,POST,DEBUG
ScriptMaps[ 6] = .rules,C:WindowsMicrosoft.NETFrameworkv4.0.30319aspnet_isapi.dll,1
ScriptMaps[ 7] = .xoml,C:WindowsMicrosoft.NETFrameworkv4.0.30319aspnet_isapi.dll,1
ScriptMaps[ 8] = .ashx,C:WindowsMicrosoft.NETFrameworkv4.0.30319aspnet_isapi.dll,1,GET,HEAD,POST,DEBUG
ScriptMaps[ 9] = .asmx,C:WindowsMicrosoft.NETFrameworkv4.0.30319aspnet_isapi.dll,1,GET,HEAD,POST,DEBUG
ScriptMaps[ 10] = .rem,C:WindowsMicrosoft.NETFrameworkv4.0.30319aspnet_isapi.dll,1,GET,HEAD,POST,DEBUG
ScriptMaps[ 11] = .soap,C:WindowsMicrosoft.NETFrameworkv4.0.30319aspnet_isapi.dll,1,GET,HEAD,POST,DEBUG
ScriptMaps[ 12] = .svc,C:WindowsMicrosoft.NETFrameworkv4.0.30319aspnet_isapi.dll,1
ScriptMaps[ 13] = .xamlx,C:WindowsMicrosoft.NETFrameworkv4.0.30319aspnet_isapi.dll,1,GET,HEAD,POST,DEBUG
ScriptMaps[ 14] = .aspq,C:WindowsMicrosoft.NETFrameworkv4.0.30319aspnet_isapi.dll,1,GET,HEAD,POST,DEBUG
ScriptMaps[ 15] = .cshtm,C:WindowsMicrosoft.NETFrameworkv4.0.30319aspnet_isapi.dll,1,GET,HEAD,POST,DEBUG
ScriptMaps[ 16] = .cshtml,C:WindowsMicrosoft.NETFrameworkv4.0.30319aspnet_isapi.dll,1,GET,HEAD,POST,DEBUG
ScriptMaps[ 17] = .vbhtm,C:WindowsMicrosoft.NETFrameworkv4.0.30319aspnet_isapi.dll,1,GET,HEAD,POST,DEBUG
ScriptMaps[ 18] = .vbhtml,C:WindowsMicrosoft.NETFrameworkv4.0.30319aspnet_isapi.dll,1,GET,HEAD,POST,DEBUG
ScriptMaps[ 19] = .axd,C:WindowsMicrosoft.NETFramework64v4.0.30319aspnet_isapi.dll,1,GET,HEAD,POST,DEBUG
ScriptMaps[ 20] = .aspx,C:WindowsMicrosoft.NETFramework64v4.0.30319aspnet_isapi.dll,1,GET,HEAD,POST,DEBUG
ScriptMaps[ 21] = .rules,C:WindowsMicrosoft.NETFramework64v4.0.30319aspnet_isapi.dll,1
ScriptMaps[ 22] = .xoml,C:WindowsMicrosoft.NETFramework64v4.0.30319aspnet_isapi.dll,1
ScriptMaps[ 23] = .ashx,C:WindowsMicrosoft.NETFramework64v4.0.30319aspnet_isapi.dll,1,GET,HEAD,POST,DEBUG
ScriptMaps[ 24] = .asmx,C:WindowsMicrosoft.NETFramework64v4.0.30319aspnet_isapi.dll,1,GET,HEAD,POST,DEBUG
ScriptMaps[ 25] = .rem,C:WindowsMicrosoft.NETFramework64v4.0.30319aspnet_isapi.dll,1,GET,HEAD,POST,DEBUG
ScriptMaps[ 26] = .soap,C:WindowsMicrosoft.NETFramework64v4.0.30319aspnet_isapi.dll,1,GET,HEAD,POST,DEBUG
ScriptMaps[ 27] = .svc,C:WindowsMicrosoft.NETFramework64v4.0.30319aspnet_isapi.dll,1
ScriptMaps[ 28] = .xamlx,C:WindowsMicrosoft.NETFramework64v4.0.30319aspnet_isapi.dll,1,GET,HEAD,POST,DEBUG
ScriptMaps[ 29] = .aspq,C:WindowsMicrosoft.NETFramework64v4.0.30319aspnet_isapi.dll,1,GET,HEAD,POST,DEBUG
ScriptMaps[ 30] = .cshtm,C:WindowsMicrosoft.NETFramework64v4.0.30319aspnet_isapi.dll,1,GET,HEAD,POST,DEBUG
ScriptMaps[ 31] = .cshtml,C:WindowsMicrosoft.NETFramework64v4.0.30319aspnet_isapi.dll,1,GET,HEAD,POST,DEBUG
ScriptMaps[ 32] = .vbhtm,C:WindowsMicrosoft.NETFramework64v4.0.30319aspnet_isapi.dll,1,GET,HEAD,POST,DEBUG
ScriptMaps[ 33] = .vbhtml,C:WindowsMicrosoft.NETFramework64v4.0.30319aspnet_isapi.dll,1,GET,HEAD,POST,DEBUG
ScriptMaps[ 34] = .svc,C:WindowsMicrosoft.NETFrameworkv2.0.50727aspnet_isapi.dll,1
ScriptMaps[ 35] = .axd,C:WindowsMicrosoft.NETFrameworkv2.0.50727aspnet_isapi.dll,1,GET,HEAD,POST,DEBUG
ScriptMaps[ 36] = .aspx,C:WindowsMicrosoft.NETFrameworkv2.0.50727aspnet_isapi.dll,1,GET,HEAD,POST,DEBUG
ScriptMaps[ 37] = .ashx,C:WindowsMicrosoft.NETFrameworkv2.0.50727aspnet_isapi.dll,1,GET,HEAD,POST,DEBUG
ScriptMaps[ 38] = .asmx,C:WindowsMicrosoft.NETFrameworkv2.0.50727aspnet_isapi.dll,1,GET,HEAD,POST,DEBUG
ScriptMaps[ 39] = .rem,C:WindowsMicrosoft.NETFrameworkv2.0.50727aspnet_isapi.dll,1,GET,HEAD,POST,DEBUG
ScriptMaps[ 40] = .soap,C:WindowsMicrosoft.NETFrameworkv2.0.50727aspnet_isapi.dll,1,GET,HEAD,POST,DEBUG
ScriptMaps[ 41] = .stm,C:Windowssystem32inetsrvssinc.dll,5,GET,POST
ScriptMaps[ 42] = .shtm,C:Windowssystem32inetsrvssinc.dll,5,GET,POST
ScriptMaps[ 43] = .shtml,C:Windowssystem32inetsrvssinc.dll,5,GET,POST
ScriptMaps[ 44] = .,C:WindowsMicrosoft.NETFrameworkv4.0.30319aspnet_isapi.dll,1,GET,HEAD,POST,DEBUG
ScriptMaps[ 45] = .,C:WindowsMicrosoft.NETFramework64v4.0.30319aspnet_isapi.dll,1,GET,HEAD,POST,DEBUG
ApplicationDependencies[ 0] = Active Server Pages;ASP
DoDynamicCompression[ 0] = True
HttpCustomHeaders[ 0] = X-Powered-By: ASP.NET