Get Ip and HostName of visitors filling in contact form

0

Good afternoon, gentlemen. I have a web application in asp.net mvc + angularjs that has a contact form. I would like to know what the user ip and hostname of him that is filling this information, I can do this in javascrip or asp.net?

    
asked by anonymous 07.05.2016 / 22:24

1 answer

0

You can use something like:

var ip =  Request.UserHostAddress;

var hostName = Request.UserHostName;

Remembering that Request you can get multiple values, such as Cookies , UserAgent , among many other data.

    
07.05.2016 / 23:23