We have Request.UserHostAddress
to get the IP address in ASP.NET, but this is usually the user\'s ISP\'s IP address, not exactly the user\'s machine IP address
Hello guys Most of the codes you will find will return you server ip address not client ip address .however this code returns correct client ip address.Give it a try. For More info just check this
https://www.youtube.com/watch?v=Nkf37DsxYjI
for getting your local ip address using javascript you can use put this code inside your script tag
and For getting your public ip address you can use put this code inside your script tag
function getIP(json) {
document.write("My public IP address is: ", json.ip);
}