Export (0) Print
Expand All
1 out of 1 rated this helpful - Rate this topic

ProcessModelInfo Class

Contains methods that return information about worker processes.

Namespace: System.Web
Assembly: System.Web (in system.web.dll)

public class ProcessModelInfo
public class ProcessModelInfo
public class ProcessModelInfo

The ProcessModelInfo class is not meant to be instantiated in your own code. Use the static GetCurrentProcessInfo and GetHistory methods to populate ProcessInfo objects, and then use the properties of the ProcessInfo objects to obtain information about the processes.

NoteNote

The GetCurrentProcessInfo and GetHistory methods can be used only with Microsoft Internet Information Services (IIS) version 5.0 on Microsoft Windows 2000 and Windows XP or with IIS 6.0 on Windows 2003 and using IIS 5.0 isolation mode. For more information, see IIS 6.0 Application Isolation Modes Overview.

The following code example demonstrates how to call the GetCurrentProcessInfo method to display statistics about the currently executing ASP.NET process on a Web page. This example will work with Internet Information Services 5.0 on Windows 2000 and Windows XP or with IIS 6.0 on Windows 2003 and using IIS 5.0 isolation mode.

<%@ Page Language="C#" %>
<%@ Import Namespace="System.Data" %>

<script runat="server">
private void Page_Load(object sender, EventArgs e)
{
    DataGrid1.DataSource = GetProcessInfoAsDataSet();
    DataGrid1.DataBind();
}

private DataSet GetProcessInfoAsDataSet()
{
    DataSet ds = new DataSet();
    ds.Tables.Add(new DataTable());
    ds.Tables[0].Columns.Add("ID",         typeof(string));
    ds.Tables[0].Columns.Add("Start Time", typeof(string));
    ds.Tables[0].Columns.Add("Age",        typeof (string));
    ds.Tables[0].Columns.Add("Request Count", typeof(string));
    ds.Tables[0].Columns.Add("Peak Memory",typeof(string));

    ProcessInfo info = ProcessModelInfo.GetCurrentProcessInfo();

    DataRow row = ds.Tables[0].NewRow();
    row["ID"]         = info.ProcessID;
    row["Start Time"] = info.StartTime;
    row["Age"]        = info.Age;
    row["Request Count"] = info.RequestCount;
    row["Peak Memory"]= info.PeakMemoryUsed;

    ds.Tables[0].Rows.Add(row);

    return ds;
}     
</script>

<html>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:DataGrid 
            ID="DataGrid1" 
            runat=server />    
    </div>
    </form>
</body>
</html>

System.Object
  System.Web.ProcessModelInfo
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Windows 98, Windows 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.

.NET Framework

Supported in: 2.0, 1.1, 1.0
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.