Retrieving client system name using c# in asp.net aplication

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Lakshmi GagniShetty
    New Member
    • Nov 2008
    • 2

    Retrieving client system name using c# in asp.net aplication

    How to retrieve the client system name using c# in asp,net application.
  • joedeene
    Contributor
    • Jul 2008
    • 579

    #2
    I don't think you can get the client's system name. If so, it would probably require the use of one of the HttpRequest Members. You can get some similar information using the .LoginUserIdent ity property, such as the current client's user name..

    joedeene

    Comment

    • PRR
      Recognized Expert Contributor
      • Dec 2007
      • 750

      #3
      try this
      Code:
      using System.Net;
      
      //IPAddress ip = new IPAddress();
             IPHostEntry host = Dns.GetHostEntry("209.85.153.104"); 
      //GetHostEntry("www.google.com"); 
                      //GetHostEntry("192...");
                      Console.WriteLine(host.HostName.ToString());
      
                      IPAddress[] aa = host.AddressList;
                      Console.WriteLine(aa[0].ToString());
      Also look into
      HttpRequest Class
      the Request class has 2 properties u may be interested in :
      UserHostName
      UserHostAddress

      Comment

      • PRR
        Recognized Expert Contributor
        • Dec 2007
        • 750

        #4
        Although Dns.GetHostByAd dress is obsolete .. you could try that too...Also
        Dns.GetHostEntr y().. doesnt seems to correctly with IPAddress ...

        Compare n see ...
        Code:
        IPHostEntry host = Dns.GetHostEntry(IPAddress.Parse("192..."));// 
                        //GetHostEntry("192...");
                        IPHostEntry my = Dns.GetHostByAddress("192...");
                        Console.WriteLine(host.HostName.ToString());
        
                        IPAddress[] aa = host.AddressList;
                        Console.WriteLine(aa[0].ToString());

        Comment

        Working...