Have a look at this code.
String ip= Server.HTMLEncode(Request.UserHostAddress);
This will give you ip as a string.
Note:
You will get 127.0.0.1 every time if you run it from localhost.
Further,refer to this link
How to get Client Machine Name in ASP.NET / C#[
^]
Regards..:)