How to get the HostName from the client using C #?

5

I need to save in that machine the user performed a certain action, for that I was using the following excerpt:

string maquina = Dns.GetHostName();

But I hardly knew that this would return the HostName of the server. How do I get the HostName of the client?

    
asked by anonymous 07.11.2017 / 18:36

1 answer

3

Use the command below:

Request.UserHostName

But in some cases it does not work. I do not know if because of the browser or the network infrastructure (eg load balance)

    
07.11.2017 / 18:40