Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <%@ Page Title="Debug" Language="C#" %>
- <%@ Import Namespace="System.Web.Hosting" %>
- <html>
- <head>
- <script language="c#" runat="server">
- StringBuilder sb = new StringBuilder();
- public void Page_Load(object sender, EventArgs e)
- {
- ApplicationManager appManager = ApplicationManager.GetApplicationManager();
- ApplicationInfo[] appInfo = appManager.GetRunningApplications();
- GridView1.DataSource = appInfo;
- String nl = "<br />";
- sb.Append("AppDomainAppId = " +
- HttpRuntime.AppDomainAppId + nl);
- sb.Append("AppDomainAppPath = " +
- HttpRuntime.AppDomainAppPath + nl);
- sb.Append("AppDomainAppVirtualPath = " +
- HttpRuntime.AppDomainAppVirtualPath + nl);
- sb.Append("AppDomainId = " +
- HttpRuntime.AppDomainId + nl);
- sb.Append("AspInstallDirectory = " +
- HttpRuntime.AspInstallDirectory + nl);
- sb.Append("BinDirectory = " +
- HttpRuntime.BinDirectory + nl);
- sb.Append("ClrInstallDirectory = " +
- HttpRuntime.ClrInstallDirectory + nl);
- sb.Append("CodegenDir = " +
- HttpRuntime.CodegenDir + nl);
- sb.Append("IsOnUNCShare = " +
- HttpRuntime.IsOnUNCShare.ToString() + nl);
- sb.Append("MachineConfigurationDirectory = " +
- HttpRuntime.MachineConfigurationDirectory + nl);
- Page.DataBind();
- Session["now"] = DateTime.Now.ToString();
- }
- public string appdomainid()
- {
- string s = HttpRuntime.AppDomainId;
- if (Session["appdomainid"] != null && Session["appdomainid"] != HttpRuntime.AppDomainId)
- {
- s = Session["appdomainid"] + "->" + s;
- }
- Session["appdomainid"] = HttpRuntime.AppDomainId;
- return s;
- }
- </script>
- <title>ASP.NET debug info</title>
- </head>
- <body>
- <form id="form1" runat="server">
- <table>
- <tr>
- <th>DateTime.Now</th>
- <td><%# DateTime.Now.ToString() %></td>
- </tr>
- <tr>
- <th>HostingEnvironment.ApplicationID</th>
- <td><%# HostingEnvironment.ApplicationID %></td>
- </tr>
- <tr>
- <th>HostingEnvironment.ApplicationPhysicalPath</th>
- <td><%# HostingEnvironment.ApplicationPhysicalPath %></td>
- </tr>
- <tr>
- <th>HostingEnvironment.ApplicationVirtualPath</th>
- <td><%# HostingEnvironment.ApplicationVirtualPath %></td>
- </tr>
- <tr>
- <th>HostingEnvironment.SiteName</th>
- <td><%# HostingEnvironment.SiteName %></td>
- </tr>
- <tr>
- <th>HostingEnvironment.ShutdownReason</th>
- <td><%# HostingEnvironment.ShutdownReason.ToString() %></td>
- </tr>
- <tr>
- <th>Environment.Version</th>
- <td><%# Environment.Version.ToString() %></td>
- </tr>
- <tr>
- <th>Environment.WorkingSet</th>
- <td><%# Environment.WorkingSet.ToString() %> bytes (<%# (Environment.WorkingSet / 1024 / 1024).ToString()%> MB)</td>
- </tr>
- <tr>
- <th>HttpRuntime.AppDomainId</th>
- <td><%# appdomainid() %></td>
- </tr>
- <tr>
- <th>GC.GetTotalMemory</th>
- <td><%# GC.GetTotalMemory(false).ToString() %> bytes (<%# (GC.GetTotalMemory(false) / 1024 / 1024).ToString() %> MB)</td>
- </tr>
- <tr>
- <th>Environment.MachineName</th>
- <td><%# Environment.MachineName %></td>
- </tr>
- <tr>
- <th>Environment.OSVersion</th>
- <td><%# Environment.OSVersion %></td>
- </tr>
- <tr>
- <th>Environment.UserName</th>
- <td><%# Environment.UserName %></td>
- </tr>
- <tr>
- <th>Environment.TickCount</th>
- <td><%# Environment.TickCount.ToString() %></td>
- </tr>
- <tr>
- <th>Session.SessionID</th>
- <td><%# Session.SessionID.ToString() %></td>
- </tr>
- <tr>
- <th>Request.ServerVariables["SERVER_SOFTWARE"]</th>
- <td><%# Request.ServerVariables["SERVER_SOFTWARE"] %></td>
- </tr>
- <tr>
- <th>AppPoolId</th>
- <td><%# Environment.GetEnvironmentVariable("APP_POOL_ID", EnvironmentVariableTarget.Process)%></td>
- </tr>
- <tr>
- <th>AppPoolId</th>
- <td><%# HttpContext.Current.Request.ServerVariables["APP_POOL_ID"] %></td>
- </tr>
- </table>
- <asp:GridView ID="GridView1" runat="server">
- </asp:GridView>
- <p><%# sb.ToString() %></p>
- <asp:Button ID="btnPostBack" runat="server" Text="ok" />
- </form>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment