Pick up Ip and Hostname of visitors who fills in contact form

Asked

Viewed 991 times

0

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

1 answer

0


You can use something like:

var ip =  Request.UserHostAddress;

var hostName = Request.UserHostName;

Recalling that the Request you can obtain various values, such as Cookies, Useragent, among many other data.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.