• IIS7.0/IIS7.5 Microsoft.Web.Administration相关操作参数详解


    关于Microsoft.Web.Administration相关操作参数详见如下代码:

    //需要引入Microsoft.Web.Administration.dll

                

    Microsoft.Web.Administration.ServerManager sm = new Microsoft.Web.Administration.ServerManager();
    
                System.Console.WriteLine("应用程序池默认设置:");
                System.Console.WriteLine("	常规:");
                System.Console.WriteLine("		.NET Framework 版本:{0}", sm.ApplicationPoolDefaults.ManagedRuntimeVersion);
                System.Console.WriteLine("		队列长度:{0}", sm.ApplicationPoolDefaults.QueueLength);
                System.Console.WriteLine("		托管管道模式:{0}", sm.ApplicationPoolDefaults.ManagedPipelineMode.ToString());
                System.Console.WriteLine("		自动启动:{0}", sm.ApplicationPoolDefaults.AutoStart);
    
                System.Console.WriteLine("	CPU:");
                System.Console.WriteLine("		处理器关联掩码:{0}", sm.ApplicationPoolDefaults.Cpu.SmpProcessorAffinityMask);
                System.Console.WriteLine("		限制:{0}", sm.ApplicationPoolDefaults.Cpu.Limit);
                System.Console.WriteLine("		限制操作:{0}", sm.ApplicationPoolDefaults.Cpu.Action.ToString());
                System.Console.WriteLine("		限制间隔(分钟):{0}", sm.ApplicationPoolDefaults.Cpu.ResetInterval.TotalMinutes);
                System.Console.WriteLine("		已启用处理器关联:{0}", sm.ApplicationPoolDefaults.Cpu.SmpAffinitized);
    
                System.Console.WriteLine("	回收:");
                System.Console.WriteLine("		发生配置更改时禁止回收:{0}", sm.ApplicationPoolDefaults.Recycling.DisallowRotationOnConfigChange);
                System.Console.WriteLine("		固定时间间隔(分钟):{0}", sm.ApplicationPoolDefaults.Recycling.PeriodicRestart.Time.TotalMinutes);
                System.Console.WriteLine("		禁用重叠回收:{0}", sm.ApplicationPoolDefaults.Recycling.DisallowOverlappingRotation);
                System.Console.WriteLine("		请求限制:{0}", sm.ApplicationPoolDefaults.Recycling.PeriodicRestart.Requests);
                System.Console.WriteLine("		虚拟内存限制(KB):{0}", sm.ApplicationPoolDefaults.Recycling.PeriodicRestart.Memory);
                System.Console.WriteLine("		专用内存限制(KB):{0}", sm.ApplicationPoolDefaults.Recycling.PeriodicRestart.PrivateMemory);
                System.Console.WriteLine("		特定时间:{0}", sm.ApplicationPoolDefaults.Recycling.PeriodicRestart.Schedule.ToString());
                System.Console.WriteLine("		生成回收事件日志条目:{0}", sm.ApplicationPoolDefaults.Recycling.LogEventOnRecycle.ToString());
    
                System.Console.WriteLine("	进程孤立:");
                System.Console.WriteLine("		可执行文件:{0}", sm.ApplicationPoolDefaults.Failure.OrphanActionExe);
                System.Console.WriteLine("		可执行文件参数:{0}", sm.ApplicationPoolDefaults.Failure.OrphanActionParams);
                System.Console.WriteLine("		已启用:{0}", sm.ApplicationPoolDefaults.Failure.OrphanWorkerProcess);
    
                System.Console.WriteLine("	进程模型:");
                System.Console.WriteLine("		Ping 间隔(秒):{0}", sm.ApplicationPoolDefaults.ProcessModel.PingInterval.TotalSeconds);
                System.Console.WriteLine("		Ping 最大响应时间(秒):{0}", sm.ApplicationPoolDefaults.ProcessModel.PingResponseTime.TotalSeconds);
                System.Console.WriteLine("		标识:{0}", sm.ApplicationPoolDefaults.ProcessModel.IdentityType);
                System.Console.WriteLine("		用户名:{0}", sm.ApplicationPoolDefaults.ProcessModel.UserName);
                System.Console.WriteLine("		密码:{0}", sm.ApplicationPoolDefaults.ProcessModel.Password);
                System.Console.WriteLine("		关闭时间限制(秒):{0}", sm.ApplicationPoolDefaults.ProcessModel.ShutdownTimeLimit.TotalSeconds);
                System.Console.WriteLine("		加载用户配置文件:{0}", sm.ApplicationPoolDefaults.ProcessModel.LoadUserProfile);
                System.Console.WriteLine("		启动时间限制(秒):{0}", sm.ApplicationPoolDefaults.ProcessModel.StartupTimeLimit.TotalSeconds);
                System.Console.WriteLine("		允许 Ping:{0}", sm.ApplicationPoolDefaults.ProcessModel.PingingEnabled);
                System.Console.WriteLine("		闲置超时(分钟):{0}", sm.ApplicationPoolDefaults.ProcessModel.IdleTimeout.TotalMinutes);
                System.Console.WriteLine("		最大工作进程数:{0}", sm.ApplicationPoolDefaults.ProcessModel.MaxProcesses);
    
                System.Console.WriteLine("	快速故障防护:");
                System.Console.WriteLine("		“服务不可用”响应类型:{0}", sm.ApplicationPoolDefaults.Failure.LoadBalancerCapabilities.ToString());
                System.Console.WriteLine("		故障间隔(分钟):{0}", sm.ApplicationPoolDefaults.Failure.RapidFailProtectionInterval.TotalMinutes);
                System.Console.WriteLine("		关闭可执行文件:{0}", sm.ApplicationPoolDefaults.Failure.AutoShutdownExe);
                System.Console.WriteLine("		关闭可执行文件参数:{0}", sm.ApplicationPoolDefaults.Failure.AutoShutdownParams);
                System.Console.WriteLine("		已启用:{0}", sm.ApplicationPoolDefaults.Failure.RapidFailProtection);
                System.Console.WriteLine("		最大故障数:{0}", sm.ApplicationPoolDefaults.Failure.RapidFailProtectionMaxCrashes);
                System.Console.WriteLine("		允许32位应用程序运行在64位 Windows 上:{0}", sm.ApplicationPoolDefaults.Enable32BitAppOnWin64);
    
                System.Console.WriteLine();
                System.Console.WriteLine("网站默认设置:");
                System.Console.WriteLine("	常规:");
                System.Console.WriteLine("		物理路径凭据:UserName={0}, Password={1}", sm.VirtualDirectoryDefaults.UserName, sm.VirtualDirectoryDefaults.Password);
                System.Console.WriteLine("		物理路径凭据登录类型:{0}", sm.VirtualDirectoryDefaults.LogonMethod.ToString());
                System.Console.WriteLine("		应用程序池:{0}", sm.ApplicationDefaults.ApplicationPoolName);
                System.Console.WriteLine("		自动启动:{0}", sm.SiteDefaults.ServerAutoStart);
                System.Console.WriteLine("	行为:");
                System.Console.WriteLine("		连接限制:");
                System.Console.WriteLine("			连接超时(秒):{0}", sm.SiteDefaults.Limits.ConnectionTimeout.TotalSeconds);
                System.Console.WriteLine("			最大并发连接数:{0}", sm.SiteDefaults.Limits.MaxConnections);
                System.Console.WriteLine("			最大带宽(字节/秒):{0}", sm.SiteDefaults.Limits.MaxBandwidth);
                System.Console.WriteLine("		失败请求跟踪:");
                System.Console.WriteLine("			跟踪文件的最大数量:{0}", sm.SiteDefaults.TraceFailedRequestsLogging.MaxLogFiles);
                System.Console.WriteLine("			目录:{0}", sm.SiteDefaults.TraceFailedRequestsLogging.Directory);
                System.Console.WriteLine("			已启用:{0}", sm.SiteDefaults.TraceFailedRequestsLogging.Enabled);
                System.Console.WriteLine("		已启用的协议:{0}", sm.ApplicationDefaults.EnabledProtocols);
    
                foreach (var s in sm.Sites)//遍历网站
                {
                    System.Console.WriteLine();
                    System.Console.WriteLine("模式名:{0}", s.Schema.Name);
                    System.Console.WriteLine("编号:{0}", s.Id);
                    System.Console.WriteLine("网站名称:{0}", s.Name);
                    System.Console.WriteLine("物理路径:{0}", s.Applications["/"].VirtualDirectories["/"].PhysicalPath);
                    System.Console.WriteLine("物理路径凭据:{0}", s.Methods.ToString());
                    System.Console.WriteLine("应用程序池:{0}", s.Applications["/"].ApplicationPoolName);
                    System.Console.WriteLine("已启用的协议:{0}", s.Applications["/"].EnabledProtocols);
                    System.Console.WriteLine("自动启动:{0}", s.ServerAutoStart);
                    System.Console.WriteLine("运行状态:{0}", s.State.ToString());
    
                    System.Console.WriteLine("网站绑定:");
                    foreach (var tmp in s.Bindings)
                    {
                        System.Console.WriteLine("	类型:{0}", tmp.Protocol);
                        System.Console.WriteLine("	IP 地址:{0}", tmp.EndPoint.Address.ToString());
                        System.Console.WriteLine("	端口:{0}", tmp.EndPoint.Port.ToString());
                        System.Console.WriteLine("	主机名:{0}", tmp.Host);
                        //System.Console.WriteLine(tmp.BindingInformation);
                        //System.Console.WriteLine(tmp.CertificateStoreName);
                        //System.Console.WriteLine(tmp.IsIPPortHostBinding);
                        //System.Console.WriteLine(tmp.IsLocallyStored);
                        //System.Console.WriteLine(tmp.UseDsMapper);
                    }
    
                    System.Console.WriteLine("连接限制:");
                    System.Console.WriteLine("	连接超时(秒):{0}", s.Limits.ConnectionTimeout.TotalSeconds);
                    System.Console.WriteLine("	最大并发连接数:{0}", s.Limits.MaxConnections);
                    System.Console.WriteLine("	最大带宽(字节/秒):{0}", s.Limits.MaxBandwidth);
    
                    System.Console.WriteLine("失败请求跟踪:");
                    System.Console.WriteLine("	跟踪文件的最大数量:{0}", s.TraceFailedRequestsLogging.MaxLogFiles);
                    System.Console.WriteLine("	目录:{0}", s.TraceFailedRequestsLogging.Directory);
                    System.Console.WriteLine("	已启用:{0}", s.TraceFailedRequestsLogging.Enabled);
    
                    System.Console.WriteLine("日志:");
                    //System.Console.WriteLine("	启用日志服务:{0}", s.LogFile.Enabled);
                    System.Console.WriteLine("	格式:{0}", s.LogFile.LogFormat.ToString());
                    System.Console.WriteLine("	目录:{0}", s.LogFile.Directory);
                    System.Console.WriteLine("	文件包含字段:{0}", s.LogFile.LogExtFileFlags.ToString());
                    System.Console.WriteLine("	计划:{0}", s.LogFile.Period.ToString());
                    System.Console.WriteLine("	最大文件大小(字节):{0}", s.LogFile.TruncateSize);
                    System.Console.WriteLine("	使用本地时间进行文件命名和滚动更新:{0}", s.LogFile.LocalTimeRollover);
    
                    System.Console.WriteLine("----应用程序的默认应用程序池:{0}", s.ApplicationDefaults.ApplicationPoolName);
                    System.Console.WriteLine("----应用程序的默认已启用的协议:{0}", s.ApplicationDefaults.EnabledProtocols);
                    //System.Console.WriteLine("----应用程序的默认物理路径凭据:{0}", s.ApplicationDefaults.Methods.ToString());
                    //System.Console.WriteLine("----虚拟目录的默认物理路径凭据:{0}", s.VirtualDirectoryDefaults.Methods.ToString());
                    System.Console.WriteLine("----虚拟目录的默认物理路径凭据登录类型:{0}", s.VirtualDirectoryDefaults.LogonMethod.ToString());
                    System.Console.WriteLine("----虚拟目录的默认用户名:{0}", s.VirtualDirectoryDefaults.UserName);
                    System.Console.WriteLine("----虚拟目录的默认用户密码:{0}", s.VirtualDirectoryDefaults.Password);
                    System.Console.WriteLine("应用程序 列表:");
                    foreach (var tmp in s.Applications)
                    {
                        if (tmp.Path != "/")
                        {
                            System.Console.WriteLine("	模式名:{0}", tmp.Schema.Name);
                            System.Console.WriteLine("	虚拟路径:{0}", tmp.Path);
                            System.Console.WriteLine("	物理路径:{0}", tmp.VirtualDirectories["/"].PhysicalPath);
                            //System.Console.WriteLine("	物理路径凭据:{0}", tmp.Methods.ToString());
                            System.Console.WriteLine("	应用程序池:{0}", tmp.ApplicationPoolName);
                            System.Console.WriteLine("	已启用的协议:{0}", tmp.EnabledProtocols);
                        }
                        System.Console.WriteLine("	虚拟目录 列表:");
                        foreach (var tmp2 in tmp.VirtualDirectories)
                        {
                            if (tmp2.Path != "/")
                            {
                                System.Console.WriteLine("		模式名:{0}", tmp2.Schema.Name);
                                System.Console.WriteLine("		虚拟路径:{0}", tmp2.Path);
                                System.Console.WriteLine("		物理路径:{0}", tmp2.PhysicalPath);
                                //System.Console.WriteLine("		物理路径凭据:{0}", tmp2.Methods.ToString());
                                System.Console.WriteLine("		物理路径凭据登录类型:{0}", tmp2.LogonMethod.ToString());
                            }
                        }
                    }
                }
  • 相关阅读:
    IE6-IE11兼容性问题列表及解决办法
    EJB--事务管理 .
    JDBC批处理---(java 对数据库的回滚) .
    redisb并发访问慢出现的问题
    redis其他问题
    多线程实现服务器端接收连接
    序列化作用
    redis的key过期时间
    nginx负载均衡和反向代理有什么区别
    nginx的负载均衡和反响代理配置
  • 原文地址:https://www.cnblogs.com/devinhua/p/3676546.html
Copyright © 2020-2023  润新知