共用方式為


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)

適用於