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() + "\r\n"; } }
PInfo的結果是:
KeyType[ 0] = IIsWebService
SslUseDsMapper[ 0] = False
LogFileDirectory[ 0] = C:\inetpub\logs\LogFiles
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\temp\ASP Compiled Templates
HttpErrors[ 0] = 401,*,FILE,C:\inetpub\custerr\zh-CN\401.htm
HttpErrors[ 1] = 403,*,FILE,C:\inetpub\custerr\zh-CN\403.htm
HttpErrors[ 2] = 404,*,FILE,C:\inetpub\custerr\zh-CN\404.htm
HttpErrors[ 3] = 405,*,FILE,C:\inetpub\custerr\zh-CN\405.htm
HttpErrors[ 4] = 406,*,FILE,C:\inetpub\custerr\zh-CN\406.htm
HttpErrors[ 5] = 412,*,FILE,C:\inetpub\custerr\zh-CN\412.htm
HttpErrors[ 6] = 500,*,FILE,C:\inetpub\custerr\zh-CN\500.htm
HttpErrors[ 7] = 501,*,FILE,C:\inetpub\custerr\zh-CN\501.htm
HttpErrors[ 8] = 502,*,FILE,C:\inetpub\custerr\zh-CN\502.htm
SSIExecDisable[ 0] = False
AccessSSLFlags[ 0] = 0
NTAuthenticationProviders[ 0] = Negotiate,NTLM
WebSvcExtRestrictionList[ 0] = 0,*.exe
WebSvcExtRestrictionList[ 1] = 0,*.dll
WebSvcExtRestrictionList[ 2] = 1,C:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll,1,ASP.NET v4.0.30319,ASP.NET v4.0.30319
WebSvcExtRestrictionList[ 3] = 1,C:\Windows\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll,1,ASP.NET v4.0.30319,ASP.NET v4.0.30319
WebSvcExtRestrictionList[ 4] = 1,C:\Windows\system32\inetsrv\asp.dll,1,ASP,Active Server Pages
WebSvcExtRestrictionList[ 5] = 1,C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\isapi\_vti_aut\author.dll,1,Windows SharePoint Services V3,Windows SharePoint Services V3
WebSvcExtRestrictionList[ 6] = 1,C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\isapi\_vti_adm\admin.dll,1,Windows SharePoint Services V3,Windows SharePoint Services V3
WebSvcExtRestrictionList[ 7] = 1,C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\isapi\shtml.dll,1,Windows SharePoint Services V3,Windows SharePoint Services V3
WebSvcExtRestrictionList[ 8] = 1,C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\isapi\owssvr.dll,1,Windows SharePoint Services V3,Windows SharePoint Services V3
WebSvcExtRestrictionList[ 9] = 1,C:\Windows\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll,1,ASP.NET v2.0.50727,ASP.NET v2.0.50727
AccessFlags[ 0] = 513
ScriptMaps[ 0] = .rules,C:\Windows\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll,1
ScriptMaps[ 1] = .xoml,C:\Windows\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll,1
ScriptMaps[ 2] = .asp,C:\Windows\system32\inetsrv\asp.dll,5,GET,HEAD,POST
ScriptMaps[ 3] = .cer,C:\Windows\system32\inetsrv\asp.dll,5,GET,HEAD,POST
ScriptMaps[ 4] = .axd,C:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll,1,GET,HEAD,POST,DEBUG
ScriptMaps[ 5] = .aspx,C:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll,1,GET,HEAD,POST,DEBUG
ScriptMaps[ 6] = .rules,C:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll,1
ScriptMaps[ 7] = .xoml,C:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll,1
ScriptMaps[ 8] = .ashx,C:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll,1,GET,HEAD,POST,DEBUG
ScriptMaps[ 9] = .asmx,C:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll,1,GET,HEAD,POST,DEBUG
ScriptMaps[ 10] = .rem,C:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll,1,GET,HEAD,POST,DEBUG
ScriptMaps[ 11] = .soap,C:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll,1,GET,HEAD,POST,DEBUG
ScriptMaps[ 12] = .svc,C:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll,1
ScriptMaps[ 13] = .xamlx,C:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll,1,GET,HEAD,POST,DEBUG
ScriptMaps[ 14] = .aspq,C:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll,1,GET,HEAD,POST,DEBUG
ScriptMaps[ 15] = .cshtm,C:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll,1,GET,HEAD,POST,DEBUG
ScriptMaps[ 16] = .cshtml,C:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll,1,GET,HEAD,POST,DEBUG
ScriptMaps[ 17] = .vbhtm,C:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll,1,GET,HEAD,POST,DEBUG
ScriptMaps[ 18] = .vbhtml,C:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll,1,GET,HEAD,POST,DEBUG
ScriptMaps[ 19] = .axd,C:\Windows\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll,1,GET,HEAD,POST,DEBUG
ScriptMaps[ 20] = .aspx,C:\Windows\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll,1,GET,HEAD,POST,DEBUG
ScriptMaps[ 21] = .rules,C:\Windows\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll,1
ScriptMaps[ 22] = .xoml,C:\Windows\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll,1
ScriptMaps[ 23] = .ashx,C:\Windows\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll,1,GET,HEAD,POST,DEBUG
ScriptMaps[ 24] = .asmx,C:\Windows\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll,1,GET,HEAD,POST,DEBUG
ScriptMaps[ 25] = .rem,C:\Windows\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll,1,GET,HEAD,POST,DEBUG
ScriptMaps[ 26] = .soap,C:\Windows\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll,1,GET,HEAD,POST,DEBUG
ScriptMaps[ 27] = .svc,C:\Windows\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll,1
ScriptMaps[ 28] = .xamlx,C:\Windows\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll,1,GET,HEAD,POST,DEBUG
ScriptMaps[ 29] = .aspq,C:\Windows\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll,1,GET,HEAD,POST,DEBUG
ScriptMaps[ 30] = .cshtm,C:\Windows\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll,1,GET,HEAD,POST,DEBUG
ScriptMaps[ 31] = .cshtml,C:\Windows\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll,1,GET,HEAD,POST,DEBUG
ScriptMaps[ 32] = .vbhtm,C:\Windows\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll,1,GET,HEAD,POST,DEBUG
ScriptMaps[ 33] = .vbhtml,C:\Windows\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll,1,GET,HEAD,POST,DEBUG
ScriptMaps[ 34] = .svc,C:\Windows\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll,1
ScriptMaps[ 35] = .axd,C:\Windows\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll,1,GET,HEAD,POST,DEBUG
ScriptMaps[ 36] = .aspx,C:\Windows\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll,1,GET,HEAD,POST,DEBUG
ScriptMaps[ 37] = .ashx,C:\Windows\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll,1,GET,HEAD,POST,DEBUG
ScriptMaps[ 38] = .asmx,C:\Windows\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll,1,GET,HEAD,POST,DEBUG
ScriptMaps[ 39] = .rem,C:\Windows\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll,1,GET,HEAD,POST,DEBUG
ScriptMaps[ 40] = .soap,C:\Windows\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll,1,GET,HEAD,POST,DEBUG
ScriptMaps[ 41] = .stm,C:\Windows\system32\inetsrv\ssinc.dll,5,GET,POST
ScriptMaps[ 42] = .shtm,C:\Windows\system32\inetsrv\ssinc.dll,5,GET,POST
ScriptMaps[ 43] = .shtml,C:\Windows\system32\inetsrv\ssinc.dll,5,GET,POST
ScriptMaps[ 44] = .,C:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll,1,GET,HEAD,POST,DEBUG
ScriptMaps[ 45] = .,C:\Windows\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll,1,GET,HEAD,POST,DEBUG
ApplicationDependencies[ 0] = Active Server Pages;ASP
DoDynamicCompression[ 0] = True
HttpCustomHeaders[ 0] = X-Powered-By: ASP.NET