天天看點

ASP.NET擷取伺服器資訊

 label1.text = "伺服器名稱:"+server.machinename;//伺服器名稱

 label2.text = "伺服器ip位址:" + request.servervariables["local_addr"];//伺服器ip位址

 label3.text = "伺服器域名:" + request.servervariables["server_name"];//伺服器域名

label4.text = ".net解釋引擎版本:" + ".net clr" + environment.version.major + "." + environment.version.minor + "." + environment.version.build + "." + environment.version.revision;//.net解釋引擎版本

label5.text = "伺服器作業系統版本:" + environment.osversion.tostring();//伺服器作業系統版本

label6.text = "伺服器iis版本:" + request.servervariables["server_software"];//伺服器iis版本

label7.text = "http通路端口:" + request.servervariables["server_port"];//http通路端口

label8.text = "虛拟目錄的絕對路徑:" + request.servervariables["appl_rhysical_path"];//虛拟目錄的絕對路徑

label9.text = "執行檔案的絕對路徑:" + request.servervariables["path_translated"];//執行檔案的絕對路徑

label10.text = "虛拟目錄session總數:" + session.contents.count.tostring();//虛拟目錄session總數

label11.text = "虛拟目錄application總數:" + application.contents.count.tostring();//虛拟目錄application總數

label12.text = "域名主機:" + request.servervariables["http_host"];//域名主機

label13.text = "伺服器區域語言:" + request.servervariables["http_accept_language"];//伺服器區域語言

label14.text = "使用者資訊:" + request.servervariables["http_user_agent"];

label14.text="cpu個數:"+environment.getenvironmentvariable("number_of_processors");//cpu個數

label15.text = "cpu類型:" + environment.getenvironmentvariable("processor_identifier");//cpu類型

label16.text = "程序開始時間:" + getprstart();//程序開始時間

label17.text = "aspnet 記憶體占用:" + getaspnetn();//aspnet 記憶體占用

label18.text = "aspnet cpu時間:" + getaspnetcpu();//aspnet cpu時間

label19.text = "fso 文本檔案讀寫:" + check("scripting.filesystemobject");//fso 文本檔案讀寫

label20.text = "應用程式占用記憶體" + getserverappn();//應用程式占用記憶體

繼續閱讀