ServerManagementUnit 类

定义

封装有关所管理服务器的上下文信息。

public ref class ServerManagementUnit sealed : Microsoft::Web::Management::Server::ManagementUnit
public sealed class ServerManagementUnit : Microsoft.Web.Management.Server.ManagementUnit
type ServerManagementUnit = class
    inherit ManagementUnit
Public NotInheritable Class ServerManagementUnit
Inherits ManagementUnit
继承
ServerManagementUnit

示例

以下示例将信息发送到 ServerManagementUnit 跟踪侦听器。

void traceMU() {

    ServerManagementUnit smu = ManagementUnit as ServerManagementUnit;

    if (smu != null) {
        string FMV = smu.FrameworkVersions.ToString();
        Trace.WriteLine("FrameworkVersions = " + FMV);
        Trace.WriteLine("MachineName = " + smu.MachineName);
        ApplicationManagementUnit amu =
            smu.GetApplication("rickaSite", "/ra");
        Trace.WriteLine("App FrameworkVersion = "
            + amu.FrameworkVersion.Text);
        SiteManagementUnit rickaSMU = smu.GetSite("rickaSite");
        string rwcp = rickaSMU.ConfigurationMap.RootWebConfigurationPath;
        Trace.WriteLine("RootWebConfigurationPath = " + rwcp);
        ManagementScope ms = smu.Scope;
        Trace.WriteLine("Scope = " + ms.ToString());


    } else {

        ApplicationManagementUnit appUnit = 
            ManagementUnit as ApplicationManagementUnit;
        if (appUnit != null)
            traceAppUnit();
    }

} 

注解

ServerManagementUnit () ApplicationHost.config或根Web.config文件访问根级别的配置信息。 有关更多信息,请参见 SiteManagementUnitApplicationManagementUnit 类。 不能直接创建 ServerManagementUnit 对象;只能从 Microsoft.Web.Management.Server.ModuleProvider.ManagementUnit 属性获取一个对象。

属性

Administration

获取当前管理管理配置。

(继承自 ManagementUnit)
Configuration

获取当前管理单元的配置信息。

(继承自 ManagementUnit)
ConfigurationMap

获取管理单元的配置映射。

(继承自 ManagementUnit)
ConfigurationPath

获取当前管理单元的配置路径信息。

(继承自 ManagementUnit)
Context

获取当前管理单元的管理上下文信息。

(继承自 ManagementUnit)
FrameworkVersion

获取当前管理单元的.NET Framework版本。

(继承自 ManagementUnit)
FrameworkVersions

获取当前管理单元上下文的已安装.NET Framework版本。

IsUserServerAdministrator

获取一个值,该值指示调用用户是否为服务器管理员。

(继承自 ManagementUnit)
MachineName

获取服务器的计算机名称。

Scope

获取服务器管理单元的范围。

ServerManager

获取管理单元的服务器管理器。

(继承自 ManagementUnit)

方法

CreateConfigurationMap(Boolean)

在派生类中重写时,创建一个文件映射,其中包含适用于此管理单元的全局配置信息。

(继承自 ManagementUnit)
GetApplication(String, String)

返回指定站点名称和应用程序路径的应用程序管理单元。

GetAssociatedFrameworkVersion()

在派生类中重写时,返回管理单元的.NET Framework版本。

(继承自 ManagementUnit)
GetModuleProviders(Type)

返回指定类型的模块提供程序的集合。

(继承自 ManagementUnit)
GetModuleService(String)

检索与 ModuleService 指定模块名称对应的 对象。

(继承自 ManagementUnit)
GetSite(String)

返回指定网站名称的站点管理单元。

GetTypeInformation(String)

GetTypeInformation(String, Boolean, Type)在派生类中重写方法时,检索当前管理作用域中派生自指定基类型名称的所有类型的程序集限定类型名称。

(继承自 ManagementUnit)
GetTypeInformation(String, Boolean)

GetTypeInformation(String, Boolean, Type)在派生类中重写方法时,检索当前管理范围内派生自指定基类型名称的所有类型的程序集限定类型名称,可以选择包括非公共类型。

(继承自 ManagementUnit)
GetTypeInformation(String, Boolean, Type)

返回指定基类型名称和生成器类型的公共类型信息,并选择性地包括非公共类型。

Update()

提交 对 的 ManagementUnit更改。

(继承自 ManagementUnit)

适用于