Organizational Research By

Surprising Reserch Topic

how can i read the clients machine computer name from the browser


how can i read the clients machine computer name from the browser  using -'javascript,asp.net,computer-name'
asked Sep 9, 2015 by rajesh
0 votes
5 views



Related Hot Questions



Government Jobs Opening

answered Sep 9, 2015 by rajesh
0 votes

Erm is there any reason why you can't just use the HttpRequest? This would be on the server side but you could pass it to the javascript if you needed to?

Page.Request.UserHostName

HttpRequest.UserHostName

The one problem with this is it would only really work in an Intranet environment otherwise it would just end up picking up the users Router or Proxy address...

answered Sep 9, 2015 by rajesh
0 votes

Page.Request.UserHostName is also “great if you want info about the server”

But why? The name implies that it returns what we want. And the ServerVariables equivalent is advertised on Microsoft sites as doing what we want, i.e., giving the host name of the remote. Yet both are giving me the IP address (not the name) of the host running IIS.

answered Sep 9, 2015 by rajesh
0 votes

We did something like this for an inhouse bugtracking tool, it got taken out before we went live but i think it would work I think a coop student found it on the internet somewhere :)

using System;
using System.Management;
using System.Windows.Forms;
namespace ComputerInfo

{
/// 
/// Summary description for Class1.
/// 
public class CPUInfo
{
    #region Properties
    private String osVersion;
    public String OSVersion
    {
        get { return this.osVersion; }
    }

    private String machineName;
    public String MachineName
    {
        get { return this.OSVersion; }
    }

    private int width;
    public int ScreenWidth
    {
        get { return this.width; }
    }

    private int height;
    public int ScreenHeight
    {
        get { return this.height; }
    }

    private String userName;
    public String UserName
    {
        get { return this.userName; }
    }

    private String clockSpeed;
    public String ClockSpeed
    {
        get { return this.clockSpeed; }
    }

    private String procName;
    public String ProcessorName
    {
        get { return this.procName; }
    }

    private String manufacturer;
    public String ProcessorManufacturer
    {
        get { return this.manufacturer; }
    }

    private String version;
    public String ProcessorVersion
    {
        get { return this.version; }
    }

    private double ram;
    public double RAM
    {
        get { return this.ram; }
    }

    private bool usehtml;
    public bool UseHTMLFormatting
    {
        get { return this.usehtml; }
        set { usehtml = value; }
    }
    #endregion

    public CPUInfo() : this(false)
    {

    }

    public CPUInfo(bool use_html_formatting)
    {
        usehtml = use_html_formatting;
        osVersion = System.Environment.OSVersion.ToString() ;
        machineName = System.Environment.MachineName.ToString();
        width = Screen.PrimaryScreen.Bounds.Width;
        height = Screen.PrimaryScreen.Bounds.Height;
        userName = "";
        clockSpeed = "";
        procName = "";
        manufacturer = "";
        version = "";
        ram = 0.0d;
        getMachineInfo();
    }

    private void getMachineInfo()
    {
        try
        {
            using(ManagementObjectSearcher win32Proc = new ManagementObjectSearcher("select * from Win32_Processor"),
                  win32CompSys = new ManagementObjectSearcher("select * from Win32_ComputerSystem"),
                  win32Memory = new ManagementObjectSearcher("select * from Win32_PhysicalMemory"))
            {
                foreach (ManagementObject obj in win32Proc.Get())
                {
                    clockSpeed = obj["CurrentClockSpeed"].ToString();
                    procName = obj["Name"].ToString();
                    manufacturer = obj["Manufacturer"].ToString();
                    version = obj["Version"].ToString();
                }
answered Sep 9, 2015 by rajesh

...