代码语言
.
CSharp
.
JS
Java
Asp.Net
C
MSSQL
PHP
Css
PLSQL
Python
Shell
EBS
ASP
Perl
ObjC
VB.Net
VBS
MYSQL
GO
Delphi
AS
DB2
Domino
Rails
ActionScript
Scala
代码分类
文件
系统
字符串
数据库
网络相关
图形/GUI
多媒体
算法
游戏
Jquery
Extjs
Android
HTML5
菜单
网页交互
WinForm
控件
企业应用
安全与加密
脚本/批处理
开放平台
其它
【
CSharp
】
一个服务器空间探针
作者:
Dezai.CN
/ 发布于
2011/6/27
/
481
<div>using System; using System.Collections; using System.ComponentModel; using System.Data; using System.Web; using System.Web.SessionState; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.HtmlControls; using System.Collections.Specialized; using System.Timers; namespace kestrel { /// <summary> /// testcheckserver 的摘要说明。 /// </summary> public class testcheckserver : System.Web.UI.Page { protected System.Web.UI.WebControls.Label current_directory; protected System.Web.UI.WebControls.Label current_username; protected System.Web.UI.WebControls.Label win_dir; protected System.Web.UI.WebControls.Label sysdir; protected System.Web.UI.WebControls.Label ps_startdir; protected System.Web.UI.WebControls.Label desktop; protected System.Web.UI.WebControls.Label osver; protected System.Web.UI.WebControls.Label drivers; protected System.Web.UI.WebControls.Label httpuseragent; protected System.Web.UI.WebControls.Label serveriis; protected System.Web.UI.WebControls.Label APPL_MD_PATH; protected System.Web.UI.WebControls.Label APPL_PHYSICAL_PATH; protected System.Web.UI.WebControls.Label GATEWAY_INTERFACE; protected System.Web.UI.WebControls.Label HTTPS; protected System.Web.UI.WebControls.Label LOCAL_ADDR; protected System.Web.UI.WebControls.Label PATH_INFO; protected System.Web.UI.WebControls.Label PATH_TRANSLATED; protected System.Web.UI.WebControls.Label REMOTE_ADDR; protected System.Web.UI.WebControls.Label REMOTE_HOST; protected System.Web.UI.WebControls.Label REMOTE_PORT; protected System.Web.UI.WebControls.Label REQUEST_METHOD; protected System.Web.UI.WebControls.Label SERVER_PORT; protected System.Web.UI.WebControls.Label SERVER_PROTOCOL; protected System.Web.UI.WebControls.Label SERVER_SOFTWARE; protected System.Web.UI.WebControls.Label HTTP_CONNECTION; protected System.Web.UI.WebControls.Label HTTP_ACCEPT; protected System.Web.UI.WebControls.Label HTTP_ACCEPT_ENCODING; protected System.Web.UI.WebControls.Label HTTP_ACCEPT_LANGUAGE; protected System.Web.UI.WebControls.Label HTTP_COOKIE; protected System.Web.UI.WebControls.Label access; protected System.Web.UI.WebControls.Label server_name; protected System.Web.UI.WebControls.Label sessioncount; protected System.Web.UI.WebControls.Label appcount; protected System.Web.UI.WebControls.Label exectime; protected System.Web.UI.WebControls.Label sessionid; protected System.Web.UI.WebControls.Label fsosup; private void Page_Load(object sender, System.EventArgs e) { if(!Page.IsPostBack) { DateTime nowtime=DateTime.Now; server_name.Text=Server.MachineName.ToLower(); //server_name=Request.ServerVariables("SERVER_NAME"); current_directory.Text=Environment.CurrentDirectory.ToLower(); current_username.Text=Environment.UserName.ToLower(); win_dir.Text=Environment.GetEnvironmentVariable("windir").ToLower(); sysdir.Text=Environment.SystemDirectory.ToLower(); ps_startdir.Text=Environment.CurrentDirectory.ToLower(); desktop.Text=Environment.GetFolderPath(Environment.SpecialFolder.Cookies); // LOCAL_ADDR.Text=Request.ServerVariables["LOCAL_ADDR"]; osver.Text=Environment.OSVersion.ToString(); //得到系统用户盘符 string[] driver=Environment.GetLogicalDrives(); string tempdiv=""; foreach(string t in driver) { tempdiv+=t+" "; } drivers.Text=tempdiv; //显示用户ip的 //serverip.Text=Request.ServerVariables["LOCAL_ADDR"]; string allhttp=Request.ServerVariables["HTTP_USER_AGENT"].ToString(); httpuseragent.Text=allhttp.ToLower(); serveriis.Text=Request.ServerVariables["SERVER_SOFTWARE"]; APPL_MD_PATH.Text=Request.ServerVariables["APPL_MD_PATH"]; APPL_PHYSICAL_PATH.Text=Request.ServerVariables["APPL_PHYSICAL_PATH"]; GATEWAY_INTERFACE.Text=Request.ServerVariables["GATEWAY_INTERFACE"]; HTTPS.Text=Request.ServerVariables["HTTPS"]; LOCAL_ADDR.Text=Request.ServerVariables["LOCAL_ADDR"]; PATH_INFO.Text=Request.ServerVariables["PATH_INFO"]; PATH_TRANSLATED.Text=Request.ServerVariables["PATH_TRANSLATED"]; REMOTE_ADDR.Text=Request.ServerVariables["REMOTE_ADDR"]; REMOTE_HOST.Text=Request.ServerVariables["REMOTE_HOST"]; REMOTE_PORT.Text=Request.ServerVariables["REMOTE_PORT"]; REQUEST_METHOD.Text=Request.ServerVariables["REQUEST_METHOD"]; SERVER_PORT.Text=Request.ServerVariables["SERVER_PORT"]; SERVER_PROTOCOL.Text=Request.ServerVariables["SERVER_PROTOCOL"]; SERVER_SOFTWARE.Text=Request.ServerVariables["SERVER_SOFTWARE"]; HTTP_CONNECTION.Text=Request.ServerVariables["HTTP_CONNECTION"]; HTTP_ACCEPT.Text=Request.ServerVariables["HTTP_ACCEPT"]; HTTP_ACCEPT_ENCODING.Text=Request.ServerVariables["HTTP_ACCEPT_ENCODING"]; HTTP_ACCEPT_LANGUAGE.Text=Request.ServerVariables["HTTP_ACCEPT_LANGUAGE"]; HTTP_COOKIE.Text=Request.ServerVariables["HTTP_COOKIE"]; sessionid.Text=Session.SessionID.ToString(); /* * 这段代码可以打印出所有的servervariales int loop1, loop2; NameValueCollection coll; // Load ServerVariable collection into NameValueCollection object. coll=Request.ServerVariables; // Get names of all keys into a string array. String[] arr1 = coll.AllKeys; for (loop1 = 0; loop1 < arr1.Length; loop1++) { Response.Write("Key: " + arr1[loop1] + ""); String[] arr2=coll.GetValues(arr1[loop1]); for (loop2 = 0; loop2 < arr2.Length; loop2++) { Response.Write("Value " + loop2 + ": " + arr2[loop2] + ""); } } */ if(checkobj("ADODB.RecordSet")) { access.Text="支持"; } else { access.Text="不支持"; } if(checkobj("Scripting.FileSystemObject")) { fsosup.Text="支持"; } else { fsosup.Text="不支持"; } sessioncount.Text=Session.Contents.Count.ToString(); appcount.Text=Application.Contents.Count.ToString(); //计算页面执行耗时 DateTime endtime=DateTime.Now; exectime.Text=((endtime-nowtime).TotalMilliseconds).ToString(); } } bool checkobj(string checkobj_str) { try { object testobj=Server.CreateObject(checkobj_str); return(true); } catch(System.Exception ex) { return (false); } } #region Web 窗体设计器生成的代码 override protected void OnInit(EventArgs e) { // // CODEGEN: 该调用是 ASP.NET Web 窗体设计器所必需的。 // InitializeComponent(); base.OnInit(e); } /// <summary> /// 设计器支持所需的方法 - 不要使用代码编辑器修改 /// 此方法的内容。 /// </summary> private void InitializeComponent() { this.Load += new System.EventHandler(this.Page_Load); } #endregion } } </div>
试试其它关键字
空间探针
同语言下
.
文件IO 操作类库
.
Check图片类型[JPEG(.jpg 、.jpeg),TIF,GIF,BMP,PNG,P
.
机器名和IP取得(IPV4 IPV6)
.
Tiff转换Bitmap
.
linqHelper
.
MadieHelper.cs
.
RegHelper.cs
.
如果关闭一个窗体后激活另一个窗体的事件或方法
.
创建日志通用类
.
串口辅助开发类
可能有用的
.
C#实现的html内容截取
.
List 切割成几份 工具类
.
SQL查询 多列合并成一行用逗号隔开
.
一行一行读取txt的内容
.
C#动态修改文件夹名称(FSO实现,不移动文件)
.
c# 移动文件或文件夹
.
c#图片添加水印
.
Java PDF转换成图片并输出给前台展示
.
网站后台修改图片尺寸代码
.
处理大图片在缩略图时的展示
Dezai.CN
贡献的其它代码
(
4037
)
.
多线程Socket服务器模块
.
生成随机密码
.
清除浮动样式
.
弹出窗口居中
.
抓取url的函数
.
使用base HTTP验证
.
div模拟iframe嵌入效果
.
通过header转向的方法
.
Session操作类
.
执行sqlite输入插入操作后获得自动编号的ID
Copyright © 2004 - 2024 dezai.cn. All Rights Reserved
站长博客
粤ICP备13059550号-3