日期:2013-08-14  浏览次数:20411 次

未经说明,本blog.csdn.net/wind7788均为本人原创代码,凡是引用或者应用请注明出处,表示对作者的尊重.

以下代码主要使用了NameValueCollection来存储信息,用HtmlTable来显示信息.以方便扩展.你也可以用xml来存储要刺探的项目,这样更有利于扩充.

using System;
using System.Collections;
using System.Collections.Specialized;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;

namespace Addr.Admin
{
?///
?/// Bougie 的摘要说明。
?///
?public class Bougie : System.Web.UI.Page
?{
??protected HtmlTable ServerInfo,ComInfo,ClientInfo;
??protected System.Web.UI.WebControls.TextBox newCom;
??protected System.Web.UI.WebControls.Button OK1;
??protected System.Web.UI.WebControls.Label resultCom;
??protected System.Web.UI.WebControls.Label resultAdd;
??protected System.Web.UI.WebControls.TextBox newExec;
??protected System.Web.UI.WebControls.ValidationSummary Val2;
??protected System.Web.UI.WebControls.Button OK2;
??protected System.Web.UI.WebControls.RangeValidator Val1;
??protected System.Web.UI.WebControls.RequiredFieldValidator Val3;
??protected System.Web.UI.HtmlControls.HtmlTableCell CopyRight;
?
??private void Page_Load(object sender, System.EventArgs e)
??{
???// 在此处放置用户代码以初始化页面
???Response.Expires = 0;
???Response.CacheControl = "no-cache";

???NameValueCollection nvcServer=new NameValueCollection();
???NameValueCollection nvcCom=new NameValueCollection();
???NameValueCollection nvcClient=new NameValueCollection();

????DateTime StartTime=DateTime.Now;
????//服务器信息
????nvcServer.Add("服务器名称",Server.MachineName);
????nvcServer.Add("服务器IP地址",Request.ServerVariables["LOCAL_ADDR"]);
????nvcServer.Add("服务器域名",Request.ServerVariables["SERVER_NAME"]);
????nvcServer.Add(".NET框架版本",Environment.Version.ToString());
????nvcServer.Add("服务器操作系统",Environment.OSVersion.ToString());
????nvcServer.Add("IIS环境",Request.ServerVariables["SERVER_SOFTWARE"]);
????nvcServer.Add("服务器端口",Request.ServerVariables["SERVER_PORT"]);
????nvcServer.Add("脚本超时设置",Server.ScriptTimeout.ToString());
????nvcServer.Add("服务器现在时间",DateTime.Now.ToString());
????nvcServer.Add("虚拟目录绝对路径",Request.ServerVariables["APPL_PHYSICAL_PATH"]);
????nvcServer.Add("执行文件绝对路进",Request.ServerVariables["PATH_TRANSLATED"]);
????nvcServer.Add("HTTPS支持",Request.ServerVariables["HTTPS"]);
????nvcServer.Add("SESSION总数",Session.Keys.Count.ToString());
????nvcServer.Add("APPLICATION总数",Application.Keys.Count.ToString());
????//组件支持情况
????if (checkObject("JMail.SmtpMail"))
????{
?????nvcCom.Add("JMail邮件","√");
????}
????else
????{
?????nvcCom.Add("JMail邮件","×");
????}
?
????if (checkObject("Persits.MailSender"))
????{
?????nvcCom.Add("Persits邮件","√");
????}
????else
????{
?????nvcCom.Add("Persits邮件","×");
????}

????if (checkObject("Geocel.Mailer"))
????{
?????nvcCom.Add("Geocel邮件","√");
????}
????else
????{
?????nvcCom.Add("Geocel邮件","×");
????}
?
????if (checkObject("SmtpMail.SmtpMail.1"))
????{
?????nvcCom.Add("SmtpMail邮件","√");
????}
????else
????{
?????nvcCom.Add("SmtpMail邮件","×");
????}
?
????if (checkObject("Persits.Upload.1"))
????{
?????nvcCom.Add("Persits上传","√");
????}
????else