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ın , PeakMemoryUsed, ProcessID, RequestCount, ShutdownReasonStartTime ve Status özelliklerini ProcessInfo kullanmayı Agegö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.GetHistorystatik yöntemleri ProcessModelInfo.GetCurrentProcessInfo tarafından döndürülür. Bu yöntemler, başlatılan bir nesne oluşturmanın tek yararlı yollarıdır.

Not

Microsoft Internet Information Services (IIS) 6.0 kullanıyorsanız, sınıflar tarafından ProcessInfo 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 üyelere eriştiğinizde ProcessInfo bir HttpException özel durum oluşturulur.

Oluşturucular

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

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 kapatıldığı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

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()

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

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

Geçerli Objectöğesinin sığ 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 dizeyi döndürür.

(Devralındığı yer: Object)

Şunlara uygulanır