Skip to content

How to Track Visitors Computer Name

suresh

Asked Nov 6, 2012, 6:41 AM EST1 answer
Share
LinkedInX
Hi,
I want to track Client System(Computer Name).Who ever accessing my site.


Ex:Some body open my site say www.test.com.


I want to get computer name who is accessing my system(www.test.com)


I used below conditions but it's showing the Server Computer Name.


String[] computer_name = System.Net.Dns.GetHostEntry(Request.ServerVariables["remote_addr"]).HostName.Split(new Char[] { '.' });
           
String ecn = System.Environment.MachineName;
 string comp_name = System.Environment.GetEnvironmentVariable("COMPUTERNAME");


Please help me.


Thanks,

1 Answer

Know the answer? Post it. Somebody with the same question will find it here.

  • Sandeep Singh Shekhawat
    0
    USE THIS:

    string computer_name = System.Net.Dns.GetHostEntry
    (Request.ServerVariables["remote_addr"]).HostName;
      Response.Write(computer_name);


    OR

    string client_computer_name = System.Net.Dns.GetHostName();
      Response.Write(client_computer_name);
    0