WorkerProcess 类

定义

定义 IIS 7 中所有工作进程通用的方法和属性。

public ref class WorkerProcess sealed : Microsoft::Web::Administration::ConfigurationElement
public sealed class WorkerProcess : Microsoft.Web.Administration.ConfigurationElement
type WorkerProcess = class
    inherit ConfigurationElement
Public NotInheritable Class WorkerProcess
Inherits ConfigurationElement
继承

示例

以下示例演示如何枚举当前正在运行的工作进程和关联的属性。

using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.Web.Administration;
using Microsoft.Web.Management;

namespace AdministrationSnippets
{
    public class MicrosoftWebAdministrationWorkerProcess
    {
        public void EnumerateWorkerProcess()
        {
            ServerManager manager = new ServerManager();
            foreach (WorkerProcess proc in manager.WorkerProcesses)
            {
                Console.WriteLine("WorkerProcess found: {0}", proc.ProcessId);
                Console.WriteLine("\t|--AppPool : {0}", proc.AppPoolName);
                Console.WriteLine("\t|--ProcGuid: {0}", proc.ProcessGuid);
                Console.WriteLine("\t|--State   : {0}", proc.State.ToString());

                foreach (ApplicationDomain appDom in proc.ApplicationDomains)
                {
                    Console.WriteLine(
                        "\t+--ApplicationDomain Found: {0}", appDom.Id);
                    Console.WriteLine(
                        "\t\t|--AppDomPhysPath: {0}", appDom.PhysicalPath);
                    Console.WriteLine(
                        "\t\t+--AppDomVirtPath: {0}", appDom.VirtualPath);
                }
            }
        }
    }
}

属性

ApplicationDomains

获取一个 ApplicationDomainCollection 对象,该对象包含当前工作进程中运行的所有应用程序域。

AppPoolName

获取工作进程的应用程序池标识符。

Attributes

获取包含此元素的属性列表的配置属性集合。

(继承自 ConfigurationElement)
ChildElements

获取当前元素的所有子元素。

(继承自 ConfigurationElement)
ElementTagName

定义 IIS 7 中所有工作进程通用的方法和属性。

(继承自 ConfigurationElement)
IsLocallyStored

获取一个值,该值指示配置元素是否存储在特定的配置文件中。

(继承自 ConfigurationElement)
Item[String]

获取或设置具有指定名称的属性。

(继承自 ConfigurationElement)
Methods

获取配置元素的方法集合。

(继承自 ConfigurationElement)
ProcessGuid

获取工作进程的 GUID。

ProcessId

获取工作进程的进程标识符。

RawAttributes

定义 IIS 7 中所有工作进程通用的方法和属性。

(继承自 ConfigurationElement)
Schema

获取当前元素的架构。

(继承自 ConfigurationElement)
State

获取当前工作进程的运行状态。

方法

Delete()

定义 IIS 7 中所有工作进程通用的方法和属性。

(继承自 ConfigurationElement)
GetAttribute(String)

返回一个 ConfigurationAttribute 对象,该对象表示请求的属性。

(继承自 ConfigurationElement)
GetAttributeValue(String)

返回指定特性的值。

(继承自 ConfigurationElement)
GetChildElement(String)

返回当前配置元素下且具有指定名称的子元素。

(继承自 ConfigurationElement)
GetChildElement(String, Type)

返回一个子元素,该子元素位于当前配置元素下,具有指定的名称和类型。

(继承自 ConfigurationElement)
GetCollection()

返回当前配置元素的默认集合。

(继承自 ConfigurationElement)
GetCollection(String)

返回属于当前配置元素的所有配置元素。

(继承自 ConfigurationElement)
GetCollection(String, Type)

返回具有指定名称和类型的配置元素,并且位于当前配置元素下。

(继承自 ConfigurationElement)
GetCollection(Type)

返回具有指定类型且位于当前配置元素下的配置元素。

(继承自 ConfigurationElement)
GetMetadata(String)

从元素架构返回元数据值。

(继承自 ConfigurationElement)
GetRequests(Int32)

返回当前工作进程中执行的所有请求。

SetAttributeValue(String, Object)

设置所指定特性的值。

(继承自 ConfigurationElement)
SetMetadata(String, Object)

设置元素架构中的元数据值。

(继承自 ConfigurationElement)

适用于