Asp.net common Display System Information

Source: Internet
Author: User
// Server computer name: [lbservername] lbservername. TEXT = "http: //" + httpcontext. current. request. URL. host + httpcontext. current. request. applicationpath; // server IP Address: [lbip] lbip. TEXT = request. servervariables ["local_addr"]; // server Domain Name: [lbdomain] lbdomain. TEXT = request. servervariables ["SERVER_NAME"]. tostring (); // server port: [lbport] lbport. TEXT = request. servervariables ["server_port"]. tostring (); // server IIS Version: [lbiisver] lbiisver. TEXT = request. servervariables ["server_software"]. tostring (); // The folder where the file is located: [lbphpath] lbphpath. TEXT = request. physicalapplicationpath; // server operating system: [lboperat] lboperat. TEXT = environment. osversion. tostring (); // The folder where the system is located: [lbsystempath] lbsystempath. TEXT = environment. systemdirectory. tostring (); // server script Timeout: [lbtimeout] lbtimeout. TEXT = (server. scripttimeout/1000 ). tostring () + "second"; // language type of the server: [lblan] lblan. TEXT = cultureinfo. installeduiculture. englishname ;//. net Framework Version: [lbaspnetver] lbaspnetver. TEXT = string. concat (new object [] {environment. version. major ,". ", environment. version. minor, environment. version. build ,". ", environment. version. revision}); // current server time: [lbcurrenttime] lbcurrenttime. TEXT = datetime. now. tostring (); registrykey = registry. localmachine. opensubkey (@ "SOFTWARE \ Microsoft \ Internet Explorer \ version vector"); // server IE version: [lbiever] lbiever. TEXT = key. getvalue ("ie", "not detected "). tostring (); // the server has run since it was last started: [lbserverlaststarttonow] lbserverlaststarttonow. TEXT = (environment. tickcount/0x3e8)/60 ). tostring () + "Minute"; string [] achdrives = directory. getlogicaldrives (); For (INT I = 0; I <directory. getlogicaldrives (). length-1; I ++) {// logical drive: [lblogicdriver] lblogicdriver. TEXT = lblogicdriver. text + achdrives [I]. tostring ();} // managementclass diskclass = new managementclass ("number_of_processors"); // total number of CPUs: [lbcpunum] lbcpunum. TEXT = environment. getenvironmentvariable ("number_of_processors "). tostring (); // CPU type: [lbcputype] lbcputype. TEXT = environment. getenvironmentvariable ("processor_identifier "). tostring (); // virtual memory: [lbmemory] lbmemory. TEXT = (environment. workingset/1024 ). tostring () + "M"; // currentProgram Memory usage: [lbmemorypro] lbmemorypro. TEXT = (double) GC. gettotalmemory (false)/1048576 ). tostring ("N2") + "M"; // ASP. net memory: [lbmemorynet] lbmemorynet. TEXT = (double) process. getcurrentprocess (). workingset64/1048576 ). tostring ("N2") + "M"; // ASP. net CPU usage: [lbcpunet] lbcpunet. TEXT = (timespan) process. getcurrentprocess (). totalprocessortime ). totalseconds. tostring ("N0 ");

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.