ProcessInfo 클래스

정의

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

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

예제

다음 코드 예제에서는 클래스의 Age, PeakMemoryUsed, ProcessID, RequestCountShutdownReasonStartTimeStatus 속성을 사용하는 방법을 보여 줍니다.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. 이러한 메서드는 초기화된 개체를 만드는 유일한 유용한 방법입니다.

메모

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

생성자

Name Description
ProcessInfo()

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

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

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

속성

Name Description
Age

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

PeakMemoryUsed

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

ProcessID

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

RequestCount

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

ShutdownReason

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

StartTime

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

Status

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

메서드

Name Description
Equals(Object)

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

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

기본 해시 함수로 사용됩니다.

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

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

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

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

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

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

ToString()

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

(다음에서 상속됨 Object)

적용 대상