ProcessInfo Sınıf

Tanım

Yürütülmekte olan işlemler hakkında bilgi sağlar.

public ref class ProcessInfo
public class ProcessInfo
type ProcessInfo = class
Public Class ProcessInfo
Devralma
ProcessInfo

Örnekler

Aşağıdaki kod örneği, sınıfın Age, PeakMemoryUsed, ProcessID, RequestCount, ShutdownReasonStartTime ve Status özelliklerini ProcessInfo kullanmayı gösterir. Örnekte bir LinkButtongörüntülenir. LinkButton öğesine tıklandığında geçerli işlem bilgileri görüntülenir.

<%@ 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>

Açıklamalar

Bu sınıf, ASP.NET işlem modeli altında çalışan ASP.NET çalışan işlemleri hakkında bilgi döndürür. Bu türdeki nesneler ve ProcessModelInfo.GetCurrentProcessInfostatik yöntemleri ProcessModelInfo.GetHistory tarafından döndürülür. Bu yöntemler, başlatılan bir nesne oluşturmanın tek yararlı yollarıdır.

Note

Microsoft Internet Information Services (IIS) 6.0 kullanıyorsanız, ProcessInfo sınıfları tarafından döndürülen işlem ölçümleri yalnızca IIS 5.0 yalıtım modunda çalışıyorsanız kullanılabilir. Çalışan işlemi yalıtım modunda IIS 6.0 kullanıyorsanız, ASP.NET işlem modeli devre dışı bırakılır ve HttpException üyelerine eriştiğinizde bir ProcessInfo özel durumu oluşturulur.

Oluşturucular

Name Description
ProcessInfo()

ProcessInfo sınıfının yeni bir örneğini başlatır.

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

Sınıfının yeni bir örneğini ProcessInfo başlatır ve işlemin durumunu belirten iç bilgileri ayarlar.

Özellikler

Name Description
Age

İşlemin çalıştığı süreyi alır.

PeakMemoryUsed

İşlemin kullandığı en fazla bellek miktarını alır.

ProcessID

İşleme atanan kimlik numarasını alır.

RequestCount

İşlem için başlangıç isteklerinin sayısını alır.

ShutdownReason

İşlemin neden kapandığını gösteren bir değer alır.

StartTime

İşlemin başlatıldığı zamanı alır.

Status

İşlemin geçerli durumunu alır.

Yöntemler

Name Description
Equals(Object)

Belirtilen nesnenin geçerli nesneye eşit olup olmadığını belirler.

(Devralındığı yer: Object)
GetHashCode()

Varsayılan karma işlevi işlevi görür.

(Devralındığı yer: Object)
GetType()

Geçerli örneğin Type alır.

(Devralındığı yer: Object)
MemberwiseClone()

Geçerli Objectbasit bir kopyasını oluşturur.

(Devralındığı yer: Object)
SetAll(DateTime, TimeSpan, Int32, Int32, ProcessStatus, ProcessShutdownReason, Int32)

İşlemin durumunu gösteren iç bilgileri ayarlar.

ToString()

Geçerli nesneyi temsil eden bir dize döndürür.

(Devralındığı yer: Object)

Şunlara uygulanır