分享
 
 
 

发布一个.net探针

王朝c#·作者佚名  2006-01-09
窄屏简体版  字體: |||超大  

未经说明,本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

????{

?????nvcCom.Add("Persits上传","×");

????}

????if (checkObject("aspcn.Upload"))

????{

?????nvcCom.Add("Paspcn上传","√");

????}

????else

????{

?????nvcCom.Add("Paspcn上传","×");

????}

????if (checkObject("LyfUpload.UploadFile"))

????{

?????nvcCom.Add("LyfUpload上传","√");

????}

????else

????{

?????nvcCom.Add("LyfUpload上传","×");

????}

?

????if (checkObject("SoftArtisans.FileManager"))

????{

?????nvcCom.Add("SoftArtisans文件管理","√");

????}

????else

????{

?????? nvcCom.Add("SoftArtisans文件管理","×");

????}

????if (checkObject("w3.upload"))

????{

?????nvcCom.Add("w3上传","√");

????}

????else

????{

?????nvcCom.Add("w3上传","×");

????}

?

????if (checkObject("W3Image.Image"))

????{

?????nvcCom.Add("W3Image图像读写","√");

????}

????else

????{

?????nvcCom.Add("W3Image图像读写","×");

????}

????if(checkObject("ADODB.Connection"))

????{

?????nvcCom.Add("ADO数据连接","√");

????}

????else

????{

?????nvcCom.Add("ADO数据连接","×");

????}

????if(checkObject("ADODB.RecordSet"))

????{

?????nvcCom.Add("ADO数据集","√");

????}

????else

????{

?????nvcCom.Add("ADO数据集","×");

????}

????if (checkObject("Scripting.FileSystemObject"))

????{

?????nvcCom.Add("FSO","√");

????}

????else

????{

?????nvcCom.Add("FSO","×");

????}

????if (checkObject("CDONTS.NewMail"))

????{

?????nvcCom.Add("CDONTS邮件","√");

????}

????else

????{

?????nvcCom.Add("CDONTS邮件","×");

????}

????//客户端信息

????nvcClient.Add("客户端IP地址",Request.ServerVariables["REMOTE_ADDR"]);

????HttpBrowserCapabilities HBC=Request.Browser;

????nvcClient.Add("客户端操作系统",HBC.Platform.ToString());

????nvcClient.Add("浏览器",HBC.Browser.ToString());

????nvcClient.Add("浏览器版本",HBC.Version.ToString());

????nvcClient.Add("VBS",HBC.VBScript.ToString());

????nvcClient.Add("JS",HBC.JavaScript.ToString());

????nvcClient.Add("ActiveX",HBC.ActiveXControls.ToString());

????nvcClient.Add("JavaApplets",HBC.JavaApplets.ToString());

????nvcClient.Add("语言",Request.ServerVariables["HTTP_ACCEPT_LANGUAGE"]);

????nvcClient.Add("框架支持",HBC.Frames.ToString());

????nvcClient.Add("Cookie支持",HBC.Cookies.ToString());

????nvcClient.Add("DOM",HBC.MSDomVersion.ToString());

????//写出数据

????writeOut(nvcServer,ServerInfo);

????writeOut(nvcCom,ComInfo);

????writeOut(nvcClient,ClientInfo);

????DateTime EndTime=DateTime.Now;

???CopyRight.InnerHtml="本页执行时间:"+((EndTime-StartTime).TotalSeconds).ToString()+"秒 ";

???CopyRight.InnerHtml+="CopyRighy ©2004 - 2006 4renx.com .netBougie version 1.0

千山一鸟作品[luo@4renx.com]";

??}

??private void writeOut(NameValueCollection nvc,HtmlTable ht)

??{

???for(int i=0;i

???{

????HtmlTableRow tr=new HtmlTableRow();

????for(int j=0;j

????{

?????HtmlTableCell td=new HtmlTableCell();

?????td.InnerHtml=nvc.GetKey(i).ToString();

?????td.Width="20%";

?????HtmlTableCell td1=new HtmlTableCell();

?????td1.InnerHtml=nvc[i].ToString();

?????td1.Width="30%";

?????tr.Controls.Add(td);

?????tr.Controls.Add(td1);

?????i++;

????}

????ht.Controls.Add(tr);

???}

??}

??private bool checkObject(string obj)

??{

???try

???{

????object meobj = Server.CreateObject(obj);

????return(true);

???}

???catch

???{

????return(false);

???}

??}

??#region Web Form Designer generated code

??override protected void OnInit(EventArgs e)

??{

???//

???// CODEGEN:该调用是 ASP.NET Web 窗体设计器所必需的。

???//

???InitializeComponent();

???base.OnInit(e);

??}

??

??///

??/// 设计器支持所需的方法 - 不要使用代码编辑器修改

??/// 此方法的内容。

??///

??private void InitializeComponent()

??{???

???this.OK1.Click += new System.EventHandler(this.OK1_Click);

???this.OK2.Click += new System.EventHandler(this.OK2_Click);

???this.Load += new System.EventHandler(this.Page_Load);

??}

??#endregion

??private void OK1_Click(object sender, System.EventArgs e)

??{

???if(checkObject(newCom.Text))

???{

????resultCom.Text="√";

???}

???else

???{

????resultCom.Text="×";

???}

??}

??private void OK2_Click(object sender, System.EventArgs e)

??{

???try

???{

????int sum=0;

????int newData=Convert.ToInt32(newExec.Text.Trim());

????DateTime startTime=DateTime.Now;

????for(int i=0;i

????{

?????sum+=i;

????}

????DateTime endTime=DateTime.Now;

????resultAdd.Text=((endTime-startTime).TotalMilliseconds).ToString()+"毫秒";

???}

???catch

???{

????resultAdd.Text="执行错误!可能是参数无效!";

???}

??}

?}

}

?

??Bougie

??

??

??

??http://schemas.microsoft.com/intellisense/ie5"

??

INPUT { FONT-SIZE: 9pt }

.td { FONT-SIZE: 9pt }

.table { BORDER-RIGHT: #6595d6 1px solid; BORDER-TOP: #6595d6 1px solid; FONT-SIZE: 9pt; BORDER-LEFT: #6595d6 1px solid; BORDER-BOTTOM: #6595d6 1px solid; BORDER-COLLAPSE: collapse }

A:link { COLOR: #000000; TEXT-DECORATION: none }

A:visited { COLOR: #000000; TEXT-DECORATION: none }

A:hover { COLOR: #000000; TEXT-DECORATION: underline }

A:active { COLOR: #000000; TEXT-DECORATION: none }

BODY { MARGIN-TOP: 0px; SCROLLBAR-FACE-COLOR: #dee3e7; FONT-SIZE: 9pt; SCROLLBAR-HIGHLIGHT-COLOR: #ffffff; MARGIN-LEFT: 0px; SCROLLBAR-SHADOW-COLOR: #dee3e7; SCROLLBAR-3DLIGHT-COLOR: #d1d7dc; SCROLLBAR-ARROW-COLOR: #006699; SCROLLBAR-TRACK-COLOR: #efefef; SCROLLBAR-DARKSHADOW-COLOR: #98aab1 }

.header { FONT-WEIGHT: bold; COLOR: #ffffff }

.table1 { BORDER-RIGHT: #6595d6 1px solid; BORDER-TOP: #6595d6 1px solid; FONT-SIZE: 9pt; BORDER-LEFT: #6595d6 1px solid; BORDER-BOTTOM: #6595d6 1px solid; BORDER-COLLAPSE: collapse }

.table2 { BORDER-RIGHT: #6595d6 1px solid; BORDER-TOP: #6595d6 1px solid; FONT-SIZE: 9pt; BORDER-LEFT: #6595d6 1px solid; BORDER-BOTTOM: #6595d6 1px solid; BORDER-COLLAPSE: collapse }

.table3 { BORDER-RIGHT: #6595d6 1px solid; BORDER-TOP: #6595d6 1px solid; FONT-SIZE: 9pt; BORDER-LEFT: #6595d6 1px solid; BORDER-BOTTOM: #6595d6 1px solid; BORDER-COLLAPSE: collapse }

.table4 { BORDER-RIGHT: #6595d6 1px solid; BORDER-TOP: #6595d6 1px solid; FONT-SIZE: 9pt; BORDER-LEFT: #6595d6 1px solid; BORDER-BOTTOM: #6595d6 1px solid; BORDER-COLLAPSE: collapse }

.table5 { BORDER-RIGHT: #6595d6 1px solid; BORDER-TOP: #6595d6 1px solid; FONT-SIZE: 9pt; BORDER-LEFT: #6595d6 1px solid; BORDER-BOTTOM: #6595d6 1px solid; BORDER-COLLAPSE: collapse }

.table6 { BORDER-RIGHT: #6595d6 1px solid; BORDER-TOP: #6595d6 1px solid; FONT-SIZE: 9pt; BORDER-LEFT: #6595d6 1px solid; BORDER-BOTTOM: #6595d6 1px solid; BORDER-COLLAPSE: collapse }

.table11 { BORDER-RIGHT: #6595d6 1px solid; BORDER-TOP: #6595d6 1px solid; FONT-SIZE: 9pt; BORDER-LEFT: #6595d6 1px solid; BORDER-BOTTOM: #6595d6 1px solid; BORDER-COLLAPSE: collapse }

.table12 { BORDER-RIGHT: #6595d6 1px solid; BORDER-TOP: #6595d6 1px solid; FONT-SIZE: 9pt; BORDER-LEFT: #6595d6 1px solid; BORDER-BOTTOM: #6595d6 1px solid; BORDER-COLLAPSE: collapse }

??

??

?

?

??

???

????

?????服务器信息

????

???

???

???

???

????

?????组件支持信息

????

???

???

???

???

????

?????客户端信息

????

???

???

???

???

????

?????组件支持查询及执行效率查询

????

????

?????自定义组件查询

?????

??????

?????

??????

?????

??????

????

????

?????加法循环测试

???????

???????

?????

??????10000000

?????

??????

?????

??????

????

???

???

????

?????

????

???

???

??

?

?

 
 
 
免责声明:本文为网络用户发布,其观点仅代表作者个人观点,与本站无关,本站仅提供信息存储服务。文中陈述内容未经本站证实,其真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
2023年上半年GDP全球前十五强
 百态   2023-10-24
美众议院议长启动对拜登的弹劾调查
 百态   2023-09-13
上海、济南、武汉等多地出现不明坠落物
 探索   2023-09-06
印度或要将国名改为“巴拉特”
 百态   2023-09-06
男子为女友送行,买票不登机被捕
 百态   2023-08-20
手机地震预警功能怎么开?
 干货   2023-08-06
女子4年卖2套房花700多万做美容:不但没变美脸,面部还出现变形
 百态   2023-08-04
住户一楼被水淹 还冲来8头猪
 百态   2023-07-31
女子体内爬出大量瓜子状活虫
 百态   2023-07-25
地球连续35年收到神秘规律性信号,网友:不要回答!
 探索   2023-07-21
全球镓价格本周大涨27%
 探索   2023-07-09
钱都流向了那些不缺钱的人,苦都留给了能吃苦的人
 探索   2023-07-02
倩女手游刀客魅者强控制(强混乱强眩晕强睡眠)和对应控制抗性的关系
 百态   2020-08-20
美国5月9日最新疫情:美国确诊人数突破131万
 百态   2020-05-09
荷兰政府宣布将集体辞职
 干货   2020-04-30
倩女幽魂手游师徒任务情义春秋猜成语答案逍遥观:鹏程万里
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案神机营:射石饮羽
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案昆仑山:拔刀相助
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案天工阁:鬼斧神工
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案丝路古道:单枪匹马
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:与虎谋皮
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:李代桃僵
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:指鹿为马
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案金陵:小鸟依人
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案金陵:千金买邻
 干货   2019-11-12
 
推荐阅读
 
 
 
>>返回首頁<<
 
靜靜地坐在廢墟上,四周的荒凉一望無際,忽然覺得,淒涼也很美
© 2005- 王朝網路 版權所有