Compartilhar via


WorkerProcess.State Propriedade

Definição

Obtém o estado em execução do processo de trabalho atual.

public:
 property Microsoft::Web::Administration::WorkerProcessState State { Microsoft::Web::Administration::WorkerProcessState get(); };
public Microsoft.Web.Administration.WorkerProcessState State { get; }
member this.State : Microsoft.Web.Administration.WorkerProcessState
Public ReadOnly Property State As WorkerProcessState

Valor da propriedade

Um dos valores de WorkerProcessState.

Exemplos

O exemplo a seguir demonstra como enumerar os processos de trabalho em execução no momento e as propriedades associadas.

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);
                }
            }
        }
    }
}

Aplica-se a