码迷,mamicode.com
首页 > 其他好文 > 详细

系统探针(如图)

时间:2018-06-09 14:00:11      阅读:219      评论:0      收藏:0      [点我收藏+]

标签:opened   org   总数   toe   environ   tar   9.png   ons   send   

技术分享图片

技术分享图片
 1 <%@ Page Language="C#" AutoEventWireup="true" EnableViewState="false" CodeFile="admin_Main.aspx.cs" Inherits="admin_Main" %>
 2 
 3 <html xmlns="http://www.w3.org/1999/xhtml">
 4 <head id="Head1" runat="server">
 5     <title></title>
 6     <link href="menu/Css.css" rel="stylesheet" type="text/css" />
 7     <script src="menu/JStime.js" type="text/javascript"></script>
 8 </head>
 9 <body>
10 <form id="form1" runat="server">
11 <div>
12 
13 <table width="780" align="center" cellspacing="0">
14   <tr>
15     <td class="lanyuss" align="center" colspan="2">
16       系统探针</td>
17   </tr>
18    <tr>
19     <td class="lanyuds" width="30%" align="left">&nbsp;管理员名称:</td>
20     <td class="lanyuds" align="left">&nbsp;<asp:Label ID="Label1" ForeColor="red" runat="server" /></td>
21   </tr>
22  <tr>
23     <td class="lanyuds" align="left">&nbsp;服务器名称:</td>
24     <td class="lanyuds"align="left">&nbsp;<asp:Label ID="ComName" runat="server"></asp:Label></td>
25   </tr>
26    <tr>+
27     <td class="lanyuds" align="left">&nbsp;服务器IP地址:</td>
28     <td class="lanyuds"align="left">&nbsp;<asp:Label ID="IP" runat="server"></asp:Label></td>
29   </tr>
30    <tr>
31     <td class="lanyuds" align="left">&nbsp;服务器域名:</td>
32     <td class="lanyuds"align="left">&nbsp;<asp:Label ID="Web" runat="server"></asp:Label></td>
33   </tr>
34    <tr>
35     <td class="lanyuds" align="left">&nbsp;服务器端口:</td>
36     <td class="lanyuds"align="left">&nbsp;<asp:Label ID="Dk" runat="server"></asp:Label></td>
37   </tr>
38    <tr>
39     <td class="lanyuds" align="left">&nbsp;服务器IIS版本:</td>
40     <td class="lanyuds"align="left">&nbsp;<asp:Label ID="Iis" runat="server"></asp:Label></td>
41   </tr>
42    <tr>
43     <td class="lanyuds" align="left">&nbsp;程序所在目录:</td>
44     <td class="lanyuds"align="left">&nbsp;<asp:Label ID="Path" runat="server"></asp:Label></td>
45   </tr>
46    <tr>
47     <td class="lanyuds" align="left">&nbsp;服务器操作系统:</td>
48     <td class="lanyuds"align="left">&nbsp;<asp:Label ID="Os" runat="server"></asp:Label></td>
49   </tr>
50      <tr>
51     <td class="lanyuds" align="left">&nbsp;服务器脚本超时:</td>
52     <td class="lanyuds"align="left">&nbsp;<asp:Label ID="TimeOut" runat="server"></asp:Label></td>
53   </tr>
54    <tr>
55     <td class="lanyuds" align="left">&nbsp;.NET Framework 版本:</td>
56     <td class="lanyuds"align="left">&nbsp;<asp:Label ID="Framework" runat="server"></asp:Label></td>
57   </tr>
58      <tr>
59     <td class="lanyuds" align="left">&nbsp;服务器当前时间:</td>
60     <td class="lanyuds"align="left">&nbsp;<asp:Label ID="Time" ForeColor="red" runat="server"></asp:Label> <span id="timePlace" style="color:Red"></span></td>
61   </tr>
62      <tr>
63     <td class="lanyuds" align="left">&nbsp;服务器已运行时间:</td>
64     <td class="lanyuds"align="left">&nbsp;<asp:Label ID="StartTime" ForeColor="red" runat="server"></asp:Label></td>
65   </tr>
66        <tr>
67     <td class="lanyuds" align="left">&nbsp;Asp.net所占内存:</td>
68     <td class="lanyuds"align="left">&nbsp;<asp:Label ID="w3w" ForeColor="red" runat="server"></asp:Label></td>
69   </tr>
70      <tr>
71     <td class="lanyuds" align="left">&nbsp;逻辑驱动器数:</td>
72     <td class="lanyuds"align="left">&nbsp;<asp:Label ID="IDE" runat="server"></asp:Label></td>
73   </tr>
74        <tr>
75     <td class="lanyuds" align="left">&nbsp;当前Session数量:</td>
76     <td class="lanyuds"align="left">&nbsp;<asp:Label ID="SessionNum" runat="server"></asp:Label></td>
77   </tr>
78        <tr>
79     <td class="lanyuds" align="left">&nbsp;CPU总数:</td>
80     <td class="lanyuds"align="left">&nbsp;<asp:Label ID="CpuNum" runat="server" Text="Label"></asp:Label></td>
81   </tr>
82        <tr>
83     <td class="lanyuds" align="left">&nbsp;CPU类型:</td>
84     <td class="lanyuds"align="left">&nbsp;<asp:Label ID="CpuType" runat="server" Text="Label"></asp:Label></td>
85   </tr>
86 </table>
87 
88 </div>
89 </form>
90 
91 </body>
92 </html>
View Code

 

 

后端:

using System.IO;
using System.Diagnostics;//空间命名

技术分享图片
//后端
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.IO;
using System.Diagnostics;


public partial class admin_Main : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            Telesa.IsAdmin();


            if (Session["Admin"] != null)
            {
                Label1.Text = Session["Admin"].ToString();
            }
            else
            {
                Label1.Visible = false;
            }

            ComName.Text = Server.MachineName;
            IP.Text = Request.ServerVariables["Local_addr"];

            Web.Text = Request.ServerVariables["server_name"].ToString();

            Dk.Text = Request.ServerVariables["server_port"].ToString();

            Iis.Text = Request.ServerVariables["server_software"].ToString();

            Path.Text = Request.PhysicalApplicationPath;

            Os.Text = Environment.OSVersion.ToString();

            TimeOut.Text = (Server.ScriptTimeout / 1000).ToString() + "";
            Framework.Text = string.Concat(new object[] { Environment.Version.Major, ".", Environment.Version.Minor, ".", Environment.Version.Build, ".", Environment.Version.Revision });

            Time.Text = DateTime.Now.ToString("yyyy-MM-dd");

            StartTime.Text = (((Environment.TickCount / 0x3e8) / 60) / 60).ToString() + "\n小时";
            string[] achDrives = Directory.GetLogicalDrives();

            for (int i = 0; i < Directory.GetLogicalDrives().Length; i++)
            {
                IDE.Text = IDE.Text + achDrives[i].ToString();
            }
            w3w.Text = ((Double)Process.GetCurrentProcess().WorkingSet64 / 1048576).ToString("N2") + "M";
            CpuNum.Text = Environment.GetEnvironmentVariable("NUMBER_OF_PROCESSORS").ToString();

            CpuType.Text = Environment.GetEnvironmentVariable("PROCESSOR_IDENTIFIER").ToString();

            SessionNum.Text = Session.Contents.Count.ToString();

            
        }
    }
}
View Code

 



 

系统探针(如图)

标签:opened   org   总数   toe   environ   tar   9.png   ons   send   

原文地址:https://www.cnblogs.com/zeng-qh/p/9159199.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!