ProcessModelInfo Class
Assembly: System.Web (in system.web.dll)
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.
Note: |
|---|
| 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 Server 2003 and using IIS 5.0 isolation mode. For more information, see How to: Configure ASP.NET Applications for an ASP.NET Version. |
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 Server 2003 and using IIS 5.0 isolation mode.
<%@ Page Language="VB" %> <%@ Import Namespace="System.Data" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <script runat="server"> Sub Page_Load(sender As Object, e As EventArgs) DataGrid1.DataSource = GetProcessInfoAsDataSet() DataGrid1.DataBind() End Sub Function GetProcessInfoAsDataSet() As DataSet Dim ds As New DataSet Dim dt As New DataTable ds.Tables.Add(dt) ds.Tables(0).Columns.Add("ID", GetType(String)) ds.Tables(0).Columns.Add("Start Time", GetType(String)) ds.Tables(0).Columns.Add("Age", GetType(String)) ds.Tables(0).Columns.Add("Request Count", GetType(String)) ds.Tables(0).Columns.Add("Peak Memory", GetType(String)) Dim info As ProcessInfo info = ProcessModelInfo.GetCurrentProcessInfo() Dim row As 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 End Function </script> <html xmlns="http://www.w3.org/1999/xhtml" > <head runat="server"> <title>ASP.NET Example</title> </head> <body> <form id="form1" runat="server"> <div> <asp:DataGrid ID="DataGrid1" runat="server" /> </div> </form> </body> </html>
- AspNetHostingPermission for operating in a hosted environment. Demand value: LinkDemand; Permission value: Minimal.
- AspNetHostingPermission for operating in a hosted environment. Demand value: InheritanceDemand; Permission value: Minimal.
Note: