user.aspx
上传用户:scene123
上传日期:2010-02-19
资源大小:3311k
文件大小:11k
源码类别:

.net编程

开发平台:

C#

  1. <% @ Page Language="C#" %>
  2. <% @ Import Namespace="System.Text" %>
  3. <script runat="server">
  4. public void Page_Load(Object sender,EventArgs e)
  5. {
  6.         Response.Expires = 0;
  7.         Response.CacheControl = "no-cache";
  8.    if (!Page.IsPostBack)
  9.    {
  10.      DateTime nowtime=DateTime.Now;
  11.      SERVER_NAME.Text=Request.ServerVariables["SERVER_NAME"];
  12.      MachineName.Text=Server.MachineName;
  13.      LOCAL_ADDR.Text=Request.ServerVariables["LOCAL_ADDR"];
  14.      SERVER_PORT.Text=Request.ServerVariables["SERVER_PORT"];
  15.      ServerDateTime.Text= DateTime.Now.ToString();
  16.      SERVER_SOFTWARE.Text=Request.ServerVariables["SERVER_SOFTWARE"];
  17.      ScriptTimeout.Text=Server.ScriptTimeout.ToString();
  18.      APPL_PHYSICAL_PATH.Text=Request.ServerVariables["APPL_PHYSICAL_PATH"];
  19.      char[] de = {';'};
  20.      string allhttp=Request.ServerVariables["HTTP_USER_AGENT"].ToString();
  21.      string[] myFilename = allhttp.Split(de);
  22.      runtime.Text=myFilename[myFilename.Length-1].Replace(")"," ");
  23.      OS.Text=myFilename[2];
  24.      ServerView.Text=myFilename[1];
  25.      PATH_TRANSLATED.Text=Request.ServerVariables["PATH_TRANSLATED"];
  26.      if (checkobj("ADODB.RecordSet")){
  27.         access.Text="已安装";
  28.      }
  29.      else {
  30.         access.Text="未安装";
  31.      }
  32.      if (checkobj("Scripting.FileSystemObject")){
  33.         fso.Text="已安装";
  34.      }
  35.      else {
  36.         fso.Text="未安装";
  37.      }
  38.      
  39.      if (checkobj("CDONTS.NewMail")){
  40.         sendmail.Text="已安装";
  41.      }
  42.      else {
  43.         sendmail.Text="未安装";
  44.      }
  45.     if (checkobj("JMail.SMTPMail")){
  46.         jmail.Text="已安装";
  47.      }
  48.      else {
  49.         jmail.Text="未安装";
  50.      }
  51.      if (checkobj("LyfUpload.UploadFile")){
  52.         lyupload.Text="已安装";
  53.      }
  54.      else {
  55.         lyupload.Text="未安装";
  56.      }
  57.      if (checkobj("Persits.Upload")){
  58.         aspupload.Text="已安装";
  59.      }
  60.      else {
  61.         aspupload.Text="未安装";
  62.      }
  63.      
  64.      if (checkobj("Persits.MailSender")){
  65.         aspemail.Text="已安装";
  66.      }
  67.      else {
  68.         aspemail.Text="未安装";
  69.      }
  70.      if (checkobj("aspcn.Upload")){
  71.         aspcn.Text="已安装";
  72.      }
  73.      else {
  74.         aspcn.Text="未安装";
  75.      }
  76.      
  77.      sessioncount.Text=Session.Contents.Count.ToString();
  78.      appcount.Text=Application.Contents.Count.ToString();
  79.      DateTime passtime=DateTime.Now;
  80.      fast.Text=((passtime-nowtime).TotalMilliseconds).ToString();
  81.    } 
  82. }
  83. bool checkobj(string obj)
  84. {
  85.      try {
  86.         object meobj = Server.CreateObject(obj);
  87.         return(true);
  88.      }
  89.      catch (Exception objex) 
  90.      {
  91.         return(false);
  92.      }
  93. }
  94. public void checkinput(Object sender,EventArgs e)
  95. {
  96.      try {
  97.         string obj =other.Text;
  98. object meobj = Server.CreateObject(obj);
  99.         checkok.Text="检测结果:"+obj+" 组件存在";
  100.      }
  101.      catch (Exception objex) 
  102.      {
  103.         checkok.Text="检测结果:"+other.Text+" 组件不存在";
  104.      }
  105. }
  106. </script>
  107. <html>
  108. <head>
  109. <title>[互动.NET]ASP.NET探针1.0</title>
  110. <meta http-equiv="Content-Type" content="text/html;charset=gb2312">
  111. <style>
  112. <!--
  113. A       { COLOR: #000000;    FONT-FAMILY: 宋体;    TEXT-DECORATION: none}
  114. A:hover { COLOR: green;    FONT-FAMILY: 宋体;    TEXT-DECORATION: underline}
  115. .A2       { COLOR: green;    FONT-FAMILY: 宋体;    TEXT-DECORATION: none}
  116. .A2:hover { COLOR: #000000;    FONT-FAMILY: 宋体;    TEXT-DECORATION: underline}
  117. body    { font-family: 宋体; font-size: 9pt}
  118. td      { font-family: 宋体; font-size: 9pt}
  119. .input  { BACKGROUND-COLOR: #ffffff;BORDER:#3F8805 1px solid;FONT-SIZE: 9pt}
  120. .backc  { BACKGROUND-COLOR: #3F8805;BORDER:#3F8805 1px solid;FONT-SIZE: 9pt;color:white}
  121. -->
  122. </style>
  123. </head>
  124. <body bgcolor="#EAEAEA" text="#000000">
  125. <div align="center"><font color="#FF0000">[.NET服务器常用参数]</font><br>
  126.   <br>
  127. </div>
  128. <table width=46% height="186" border=0 align="center" cellpadding=0 cellspacing=0 bgcolor="#000000">
  129.   <tr>
  130.     <td> 
  131. <table width=461 height="255" border=0 cellpadding=0 cellspacing=1>
  132. <tr bgcolor="#99CC00" height=18> 
  133.           <td width="146" align=left>&nbsp;服务器名称:</td>
  134.           <td width="329" height="18">&nbsp; 
  135.             <asp:label id="MachineName" runat="server"/></td>
  136.         </tr>
  137.         <tr bgcolor="#99CC00" height=18> 
  138.           <td align=left>&nbsp;服务器IP地址:</td>
  139.           <td height="18">&nbsp; 
  140.             <asp:label id="LOCAL_ADDR" runat="server" /></td>
  141.         </tr>
  142.         <tr bgcolor="#99CC00" height=18> 
  143.           <td align=left>&nbsp;服务器域名:</td>
  144.           <td height="18">&nbsp; 
  145.             <asp:label id="SERVER_NAME" runat="server" />
  146.           </td>
  147.         </tr>
  148. <tr bgcolor="#99CC00" height=18> 
  149.           <td align=left>&nbsp;HTTP访问端口:</td>
  150.           <td height="18">&nbsp; 
  151.             <asp:label id="SERVER_PORT" runat="server" />
  152.           </td>
  153.         </tr>
  154.         <tr bgcolor="#99CC00" height=18> 
  155.           <td align=left>&nbsp;服务器本机时间:</td>
  156.           <td height="18">&nbsp; 
  157.             <asp:label id="ServerDateTime" runat="server" /></td>
  158.         </tr>
  159.         <tr bgcolor="#99CC00" height=18> 
  160.           <td align=left>&nbsp;服务器IIS版本:</td>
  161.           <td height="18">&nbsp; 
  162.             <asp:label id="SERVER_SOFTWARE" runat="server"/></td>
  163.         </tr>
  164.         <tr bgcolor="#99CC00" height=18> 
  165.           <td align=left>&nbsp;服务端脚本执行超时:</td>
  166.           <td height="18">&nbsp; 
  167.             <asp:label id="ScriptTimeout" runat="server"/>
  168.             秒</td>
  169.         </tr>
  170.         <tr bgcolor="#99CC00" height=18> 
  171.           <td align=left>&nbsp;虚拟目录绝对路径:</td>
  172.           <td height="18">&nbsp; 
  173.             <asp:label id="APPL_PHYSICAL_PATH" runat="server"/></td>
  174.         </tr>
  175.         <tr bgcolor="#99CC00" height=18> 
  176.           <td align=left>&nbsp;执行文件绝对路径:</td>
  177.           <td height="18">&nbsp; 
  178.             <asp:label id="PATH_TRANSLATED" runat="server"/></td>
  179.         </tr>
  180.         <tr bgcolor="#99CC00" height=18> 
  181.           <td align=left>&nbsp;服务器浏览器版本:</td>
  182.           <td height="18">&nbsp;
  183.             <asp:label id="ServerView" runat="server" /></td>
  184.         </tr>
  185.         <tr bgcolor="#99CC00" height=18>
  186.           <td align=left>&nbsp;.NET解释引擎版本:</td>
  187.           <td height="18">&nbsp;
  188.             <asp:label id="runtime" runat="server" /></td>
  189.         </tr>
  190.         <tr bgcolor="#99CC00" height=18>
  191.           <td align=left>&nbsp;服务器操作系统:</td>
  192.           <td height="18">&nbsp;
  193.             <asp:label ID="OS" runat="server"/></td>
  194.         </tr>
  195.       </table>
  196.     </td>
  197.   </tr>
  198. </table>
  199. <div align="center"><font color="#FF0000"><br>
  200.   [.NET服务器常用组件]<br>
  201.   <br>
  202.   </font></div>
  203. <table width=46% border=0 align="center" cellpadding=0 cellspacing=0 bgcolor="#000000">
  204.   <tr> 
  205.     <td> 
  206.     <table width=461 height="229" border=0 cellpadding=0 cellspacing=1>
  207.         <form runat="server" >
  208.           <tr bgcolor="#99CC00" height=18> 
  209.             <td width="146" height="18" align=left>&nbsp;Access数据库组件:</td>
  210.             <td width="312" height="18">&nbsp; <asp:label id="access" runat="server" /></td>
  211.           </tr>
  212.           <tr bgcolor="#99CC00" height=18> 
  213.             <td height="18" align=left>&nbsp;FSO文件操作组件:</td>
  214.             <td height="18">&nbsp; <asp:label id="fso" runat="server"/> </td>
  215.           </tr>
  216.           <tr bgcolor="#99CC00" height=18> 
  217.             <td height="18" align=left>&nbsp;CDONTS邮件发送组件:</td>
  218.             <td height="18">&nbsp; <asp:label id="sendmail" runat="server" /></td>
  219.           </tr>
  220.           <tr bgcolor="#99CC00" height=18> 
  221.             <td height="18" align=left>&nbsp;JMAIL邮件发送组件:</td>
  222.             <td height="18">&nbsp; <asp:label id="jmail" runat="server" /></td>
  223.           </tr>
  224.           <tr bgcolor="#99CC00" height=18> 
  225.             <td height="18" align=left>&nbsp;ASPEmail邮件发送组件:</td>
  226.             <td height="18">&nbsp; <asp:label id="aspemail" runat="server" /></td>
  227.           </tr>
  228.           <tr bgcolor="#99CC00" height=18> 
  229.             <td height="18" align=left>&nbsp;LyfUpload上传组件:</td>
  230.             <td height="18">&nbsp; <asp:label id="lyupload" runat="server" /></td>
  231.           </tr>
  232.           <tr bgcolor="#99CC00" height=18> 
  233.             <td height="18" align=left>&nbsp;ASPUpload上传组件:</td>
  234.             <td height="18">&nbsp; <asp:label id="aspupload" runat="server" /></td>
  235.           </tr>
  236.           <tr bgcolor="#99CC00" height=18> 
  237.             <td height="18" align=left>&nbsp;ASPCN上传组件:</td>
  238.             <td height="18">&nbsp; <asp:label id="aspcn" runat="server" /></td>
  239.           </tr>
  240.           <tr bgcolor="#99CC00" height=18> 
  241.             <td height="18" align=left>&nbsp;其他组件安装检测:</td>
  242.             <td height="18">&nbsp; <asp:TextBox id="other" OnTextChanged="checkinput" cssclass="input" runat="server" /> <asp:button id="submit" text="检 测" cssclass="input" runat="server"/></td>
  243.           </tr>
  244.           <tr bgcolor="#99CC00" height=18> 
  245.             <td height="18" colspan="2" align="center"> <font color="#FF0000"><asp:label ID="checkok" runat="server" /></font></td>
  246.           </tr>
  247.         </form>
  248.       </table></td>
  249.   </tr>
  250. </table>
  251. <div align="center"><font color="#FF0000"><br>
  252.   [当前虚拟目录资源状况]</font> <br>
  253.   <br>
  254.   <table width=46% border=0 align="center" cellpadding=0 cellspacing=0 bgcolor="#000000">
  255. <tr> 
  256.       <td> 
  257. <table width=461 height="29" border=0 cellpadding=0 cellspacing=1>
  258. <tr bgcolor="#99CC00" height=18> 
  259.             <td width="158" height="18" align=left>&nbsp;虚拟目录Session总数:</td>
  260.             <td width="300" height="18">&nbsp; <asp:label id="sessioncount" runat="server" />
  261.               个</td>
  262.           </tr>
  263.           <tr bgcolor="#99CC00" height=18> 
  264.             <td height="18" align=left>&nbsp;虚拟目录Application总数:</td>
  265.             <td height="18">&nbsp; <asp:label id="appcount" runat="server"/>
  266.               个</td>
  267.           </tr>
  268.         </table></td>
  269.     </tr>
  270.   </table>
  271.   <br>
  272.   <font color="#FF0000">[.NET虚拟主机速度测试]</font> <br>
  273.   <br>
  274.   <table width=46% border=0 align="center" cellpadding=0 cellspacing=0 bgcolor="#000000">
  275.     <tr> 
  276.       <td> <table width=461 height="29" border=0 cellpadding=0 cellspacing=1>
  277.           <tr bgcolor="#99CC00" height=18> 
  278.             <td width="158" height="18" align=left>&nbsp;执行本页.NET代码时间:</td>
  279.             <td width="300" height="18">&nbsp; <font color="#FF0000">
  280.               <asp:label id="fast" runat="server" />
  281.               </font> 毫秒</td>
  282.           </tr>
  283.           <tr bgcolor="#99CC00" height=18> 
  284.             <td height="18" colspan="2" align=left><br>
  285.               *以下是在各ASP.NET空间探针测试的速度,仅作参考,各位请以实测作准。<br>
  286.               <br>
  287.               [<a href="http://aspx.chinagz.net" target="_blank">互动.NET</a>] 第一次运行速度:240.3456 
  288.               毫秒 平均运行速度:20.55 毫秒<br>
  289.               <br>
  290.               [<a href="http://www.aspx.net.cn" target="_blank">先锋科技免费空间</a>] 
  291.               第一次运行速度:328.125 毫秒 平均运行速度:31.25 毫秒<br>
  292.               <br>
  293.               [<a href="http://www.brinkster.com" target="_blank">brinkster免费空间</a>] 
  294.               第一次运行速度:609.14 毫秒 平均运行速度:50.62 毫秒<br>
  295.               <br>
  296.             </td>
  297.           </tr>
  298.         </table></td>
  299.     </tr>
  300.   </table>
  301.   <br>
  302.   &copy;版权所有2002 <a href="http://aspx.chinagz.net">互动.NET</a> 探针制作:<a href="mailto:webmaster@chinagz.net">小宝.NET</a> 
  303.   QQ:3538150 MSN:webmaster@chinagz.net<br>
  304. </div>
  305. </body>
  306. </html>