Asp.net programming we consider all important topic for knowledge about controls,web Services, JSON, Ajax, database, and interview related Question. In this Asp.net and sql server tutorial blog we give many examples of jquery as like How Play YouTube Video in Your Asp.net Website by URL, How to Play YouTube Videos in Asp.net by using Jquery , Jquery Change div background on mouseover in asp.net , JQuery UI Datepicker (Calendar) etc.

Thursday, November 6, 2014

Asp.net code for get the computer's name,OSVersion,Memory Working set

How to get the information about local computer by web page:

information about local computer by web page:

In this Post we give some code by this Asp.net code you can get all the information about the local computer in which the web site or web page is run.

we can fetch  local computer information by c# code in web page.

C# code for give the possible information:


using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class Information_about_computer : System.Web.UI.Page
{

    protected void Page_Load(object sender, EventArgs e)
    {

        // get the local compurt name
        Response.Write("<h1>The MachineName is </h1>" + System.Environment.MachineName.ToString()+"</br>");

        //get the  OS Version can be identified by the following code- 
        Response.Write("<h1>The OS Version is </h1>" + System.Environment.OSVersion.ToString() + "</br>");

        //get the Memory Working set can be identified by the following code- 
        Response.Write("<h1>The Memory Working set is </h1>" + System.Environment.WorkingSet.ToString() + "<br/>");

        //get visitor ip address.
        string ipaddress;
        ipaddress = Request.ServerVariables["HTTP_X_FORWARDED_FOR"];
        if (ipaddress == "" || ipaddress == null)
            ipaddress = Request.ServerVariables["REMOTE_ADDR"];

        Response.Write("<h1>The visitor ip address is </h1>" + ipaddress + "<br/>");

    }

}



Asp.net code for get the computer's name,OSVersion,Memory Working set


Other Asp.net related post:


No comments:

Post a Comment