If you try to get ip while running application from localhost you will get something like 127.0.0.1 as said by the experts above.Have a look at the below code.
string ip=Server.HtmlEncode(Request.UserHostAddress);
This line of code,when executed on localhost,will give you something like 127.0.0.1.But suppose you host it on production server,at that time it will give you the actual client ip(
in string format),that is the one trying to interact with your web etc.