ProcessInfo 클래스

정의

현재 실행 중인 프로세스에 대한 정보를 제공합니다.

public ref class ProcessInfo
public class ProcessInfo
type ProcessInfo = class
Public Class ProcessInfo
상속
ProcessInfo

예제

다음 코드 예제를 사용 하 여 보여 줍니다.는 Age, PeakMemoryUsed, ProcessID, RequestCount, ShutdownReason, StartTimeStatus 의 속성을 ProcessInfo 클래스. 이 예제에서는 표시를 LinkButton입니다. 경우는 LinkButton 클릭 하면 현재 프로세스 정보가 표시 됩니다.

<%@ Page language="c#" AutoEventWireup="false" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
  <head>
    <title>ASP.NET Example</title>
<script language="c#" runat="server">     
      void GetProcessInfo(Object sender, EventArgs e) 
      {
        ProcessInfo pi;

        // Get the current process information.
        pi = ProcessModelInfo.GetCurrentProcessInfo();

        Literal1.Text = "<p>Age: " + pi.Age + "</p>";
        Literal1.Text += "<p>PeakMemoryUsed: " + pi.PeakMemoryUsed + "</p>";
        Literal1.Text += "<p>ProcessID: " + pi.ProcessID + "</p>";
        Literal1.Text += "<p>RequestCount: " + pi.RequestCount + "</p>";
        Literal1.Text += "<p>ShutdownReason: " + pi.ShutdownReason + "</p>";
        Literal1.Text += "<p>StartTime: " + pi.StartTime + "</p>";
        Literal1.Text += "<p>Status: " + pi.Status + "</p>";
      }
      </script>
    </head>
    <body>
    <form id="WebForm1" method="post" runat="server">
      <asp:button id="Button1" OnClick="GetProcessInfo" runat="server" Text="Get Process Info"></asp:button>
             
      <asp:Literal id="Literal1" runat="server"></asp:Literal>
    </form>
  </body>
</html>
<%@ Page language="vb" AutoEventWireup="false" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
  <head>
    <title>ASP.NET Example</title>
<script language="vb" runat="server">     
      Sub GetProcessInfo(sender As Object, e As System.EventArgs)
        Dim pi As ProcessInfo

        'Get information about the current process.
        pi = ProcessModelInfo.GetCurrentProcessInfo()

        Literal1.Text = "<p>Age: " & pi.Age.ToString & "</p>"
        Literal1.Text = Literal1.Text & "<p>PeakMemoryUsed: " & pi.PeakMemoryUsed.ToString & "</p>"
        Literal1.Text = Literal1.Text & "<p>ProcessID: " & pi.ProcessID.ToString & "</p>"
        Literal1.Text = Literal1.Text & "<p>RequestCount: " & pi.RequestCount.ToString & "</p>"
        Literal1.Text = Literal1.Text & "<p>ShutdownReason: " & pi.ShutdownReason.ToString & "</p>"
        Literal1.Text = Literal1.Text & "<p>StartTime: " & pi.StartTime.ToString & "</p>"
        Literal1.Text = Literal1.Text & "<p>Status: " & pi.Status.ToString & "</p>"
      End Sub
    </script>
  </head>
  <body>
    <form id="WebForm2" method="post" runat="server">
      <asp:button id="Button1" OnClick="GetProcessInfo" runat="server" Text="Get Process Info"></asp:button>
             
      <asp:Literal id="Literal1" runat="server"></asp:Literal>
    </form>
  </body>
</html>

설명

이 클래스는 ASP.NET 프로세스 모델에서 실행 되는 ASP.NET 작업자 프로세스에 대 한 정보를 반환 합니다. 이 형식의 개체는 정적 메서드를 반환한 ProcessModelInfo.GetCurrentProcessInfoProcessModelInfo.GetHistory입니다. 이러한 메서드는 초기화 된 개체를 만드는 유일한 방법입니다.

참고

Microsoft 인터넷 정보 서비스 (IIS) 6.0을 사용 하는 경우 처리 하 여 반환 되는 메트릭에 ProcessInfo 클래스는 IIS 5.0 격리 모드에서 실행 하는 경우에 사용할 수 있습니다. IIS 6.0 작업자 프로세스 격리 모드를 사용 하는 경우 ASP.NET 프로세스 모델을 사용할 수 없습니다 및 HttpException 에 액세스할 때 예외가 throw 됩니다 ProcessInfo 멤버입니다.

생성자

ProcessInfo()

ProcessInfo 클래스의 새 인스턴스를 초기화합니다.

ProcessInfo(DateTime, TimeSpan, Int32, Int32, ProcessStatus, ProcessShutdownReason, Int32)

ProcessInfo 클래스의 새 인스턴스를 초기화하고 프로세스의 상태를 나타내는 내부 정보를 설정합니다.

속성

Age

프로세스가 실행되고 있는 시간을 가져옵니다.

PeakMemoryUsed

프로세스에서 사용한 최대 메모리의 양을 가져옵니다.

ProcessID

프로세스에 할당된 ID 번호를 가져옵니다.

RequestCount

프로세스에 대한 시작 요청 번호를 가져옵니다.

ShutdownReason

프로세스가 종료된 이유를 나타내는 값을 가져옵니다.

StartTime

프로세스가 시작된 시간을 가져옵니다.

Status

프로세스의 현재 상태를 가져옵니다.

메서드

Equals(Object)

지정된 개체가 현재 개체와 같은지 확인합니다.

(다음에서 상속됨 Object)
GetHashCode()

기본 해시 함수로 작동합니다.

(다음에서 상속됨 Object)
GetType()

현재 인스턴스의 Type을 가져옵니다.

(다음에서 상속됨 Object)
MemberwiseClone()

현재 Object의 단순 복사본을 만듭니다.

(다음에서 상속됨 Object)
SetAll(DateTime, TimeSpan, Int32, Int32, ProcessStatus, ProcessShutdownReason, Int32)

프로세스의 상태를 나타내는 내부 정보를 설정합니다.

ToString()

현재 개체를 나타내는 문자열을 반환합니다.

(다음에서 상속됨 Object)

적용 대상