. NET Probes
Last Update:2017-02-28
Source: Internet
Author: User
Probes without explanation, this blog.csdn.net/wind7788 are my original code, any reference or application please indicate the source, to show respect for the author.
The following code mainly uses NameValueCollection to store information, and htmltable to display it. To facilitate expansion. You can also use XML to store the items you want to pry, which is more beneficial to the expansion.
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's summary description.
?///
? 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)
?? {
??? Place user code here to initialize page
??? Response.Expires = 0;
??? Response.CacheControl = "No-cache";
??? NameValueCollection nvcserver=new NameValueCollection ();
??? NameValueCollection nvccom=new NameValueCollection ();
??? NameValueCollection nvcclient=new NameValueCollection ();
???? DateTime Starttime=datetime.now;
???? Server information
???? Nvcserver.add ("server name", Server.machinename);
???? Nvcserver.add ("Server IP Address", request.servervariables["local_addr"]);
???? Nvcserver.add ("Server domain name", request.servervariables["SERVER_NAME"]);
???? Nvcserver.add (". NET Framework version ", Environment.Version.ToString ());
???? Nvcserver.add ("Server operating System", Environment.OSVersion.ToString ());
???? Nvcserver.add ("IIS Environment", request.servervariables["Server_software"]);
???? Nvcserver.add ("Server Port", request.servervariables["Server_port"]);
???? Nvcserver.add ("Script timeout Settings", Server.ScriptTimeout.ToString ());
???? Nvcserver.add ("Server Now Time", DateTime.Now.ToString ());
???? Nvcserver.add ("Virtual directory absolute path", request.servervariables["Appl_physical_path"]);
???? Nvcserver.add ("Absolute path of execution document", request.servervariables["path_translated"]);
???? Nvcserver.add ("https support", request.servervariables["https"]);
???? Nvcserver.add ("Session Total", Session.Keys.Count.ToString ());
???? Nvcserver.add ("Application Total", Application.Keys.Count.ToString ());
???? Component Support Scenarios
???? if (Checkobject ("Jmail.smtpmail"))
???? {
????? Nvccom.add ("JMail Mail", "√");
????}
???? Else
???? {
????? Nvccom.add ("JMail Mail", "X");
????}
?
???? if (Checkobject ("Persits.mailsender"))
???? {
????? Nvccom.add ("Persits Mail", "√");
????}
???? Else
???? {
????? Nvccom.add ("Persits Mail", "X");
????}
???? if (Checkobject ("Geocel.mailer"))
???? {
????? Nvccom.add ("Geocel Mail", "√");
????}
???? Else
???? {
????? Nvccom.add ("Geocel Mail", "X");
????}
?
???? if (Checkobject ("SMTPMAIL.SMTPMAIL.1"))
???? {
????? Nvccom.add ("SmtpMail Mail", "√");
????}
???? Else
???? {
????? Nvccom.add ("SmtpMail Mail", "X");
????}
?
???? if (Checkobject ("Persits.upload.1"))
???? {
????? Nvccom.add ("Persits upload", "√");
????}
???? Else
???? {
????? Nvccom.add ("Persits upload", "X");
????}
???? if (Checkobject ("ASPCN. Upload "))
???? {
????? Nvccom.add ("PASPCN upload", "√");
????}
???? Else
???? {
????? Nvccom.add ("PASPCN upload", "X");
????}
???? if (Checkobject ("Lyfupload.uploadfile"))
???? {
????? Nvccom.add ("Lyfupload upload", "√");
????}
???? Else
???? {
????? Nvccom.add ("Lyfupload upload", "X");
????}
?
???? if (Checkobject ("Softartisans.filemanager"))
???? {
????? Nvccom.add ("SoftArtisans File Management", "√");
????}
???? Else
???? {
?????? Nvccom.add ("SoftArtisans File Management", "X");
????}
???? if (Checkobject ("W3.upload"))
???? {
????? Nvccom.add ("W3 upload", "√");
????}
???? Else
???? {
????? Nvccom.add ("W3 upload", "X");
????}
?
???? if (Checkobject ("W3image.image"))
???? {
????? Nvccom.add ("W3image image reading and writing", "√");
????}
???? Else
???? {
????? Nvccom.add ("W3image image reading and writing", "X");
????}
???? if (Checkobject ("ADODB. Connection "))
???? {
????? Nvccom.add ("ADO Data Connection", "√");
????}
???? Else
???? {
????? Nvccom.add ("ADO Data Connection", "X");
????}
???? if (Checkobject ("ADODB. RecordSet "))
???? {
????? Nvccom.add ("ADO Data Set", "√");
????}
???? Else
???? {
????? Nvccom.add ("ADO DataSet", "X");
????}
???? if (Checkobject ("Scripting.FileSystemObject"))
???? {
????? Nvccom.add ("FSO", "√");
????}
???? Else
???? {
????? Nvccom.add ("FSO", "X");
????}
???? if (Checkobject ("CDONTS. NewMail "))
???? {
????? Nvccom.add ("CDONTS Mail", "√");
????}
???? Else
???? {
????? Nvccom.add ("CDONTS Mail", "X");
????}
???? Client Information
???? Nvcclient.add ("Client IP Address", request.servervariables["REMOTE_ADDR"]);
???? HttpBrowserCapabilities Hbc=request.browser;
???? Nvcclient.add ("Client operating system", HBC.) Platform.tostring ());
???? Nvcclient.add ("Browser", HBC.) Browser.tostring ());
???? Nvcclient.add ("browser version", 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 ("Language", request.servervariables["http_accept_language");
???? Nvcclient.add ("Framework Support", HBC. Frames.tostring ());
???? Nvcclient.add ("Cookie Support", HBC.) Cookies.tostring ());
???? Nvcclient.add ("DOM", HBC.) Msdomversion.tostring ());
???? Write Data
???? Writeout (Nvcserver,serverinfo);
???? Writeout (Nvccom,cominfo);
???? Writeout (Nvcclient,clientinfo);
???? DateTime Endtime=datetime.now;
??? Copyright.innerhtml= "Page Execution Time:" + (Endtime-starttime). totalseconds). ToString () + "seconds";
??? copyright.innerhtml+= "copyrighy©2004-2006 4renx.com. Netbougie Version 1.0
A bird works in Qianshan [luo@4renx.com] ";
??}
?? private void Writeout (NameValueCollection nvc,htmltable HT)
?? {
??? for (int i=0;i??? {
???? HtmlTableRow tr=new HtmlTableRow ();
???? for (int j=0;j<2;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: This call is required for the ASP.net Web forms Designer.
??? //
??? InitializeComponent ();
??? Base. OnInit (e);
??}
??
?? ///
?? Designer supports required methods-do not use the Code editor to modify
?? The contents of this method.
?? ///
?? 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= "X";
???}
??}
?? 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 () + "millisecond";
???}
??? Catch
??? {
???? resultadd.text= "Execution Error!" may be an invalid parameter! ";
???}
??}
?}
}
?
??
??
??
??
?? http://schemas.microsoft.com/intellisense/ie5 ">
??
??
?
?
??
???
????
????? Server information
????
???
???
???
???
????
????? Component Support Information
????
???
???
???
???
????
????? Client Information
????
???
???
???
???
????
????? Component support query and execution efficiency query
????
????
????? Custom Component Queries
?????
??????
?????
??????
?????
??????
????
????
????? Addition Cycle test
???????
???????
?????
?????? 10000000
?????
??????
?????
??????
????
???
???
????
?????
????
???
???
??
?
?