You can use the following three ways to get the client IP address using C#
string test = Request.UserHostAddress.ToString();
string test2 = Request.ServerVariables["REMOTE_ADDR"].ToString();
string test3 = Context.Request.UserHostAddress.ToString();
Some times client can mask their IP behind a router/nat and it's spoofable.
No comments:
Post a Comment