ManagementUnit.GetModuleService(String) 方法

定义

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

public:
 Microsoft::Web::Management::Server::ModuleService ^ GetModuleService(System::String ^ moduleName);
public Microsoft.Web.Management.Server.ModuleService GetModuleService (string moduleName);
member this.GetModuleService : string -> Microsoft.Web.Management.Server.ModuleService
Public Function GetModuleService (moduleName As String) As ModuleService

参数

moduleName
String

实现服务的模块的名称。

返回

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

示例

以下示例使用 GetModuleService 方法检索模块信息并将其写入跟踪输出。

ManagementUnit mu = this.ManagementUnit;
string modName = "rHeil";
ModuleService ms = mu.GetModuleService(modName);
if(ms != null)
Trace.WriteLine("ModuleService for " + modName + " : " +
    ms.ToString()); 

注解

如果指定的 ModuleService 对象不可用或不适用于此 ManagementUnit,则返回值为 null

适用于