0
Answer

Get client IP address [Not Host] in C# .NET web services

bapashree

bapashree

18y
3.1k
1
Hi,

I create one web service using c# .net and in this web service I want to get an IP address for client. I check thousend of article but that is not working, let me give you one example

System.Web.HttpContext.Current.Request.UserHostAddress;
System.Web.HttpContext.Current.Request.ServerVariables["REMOTE_ADDR"];

This is gives me IP but that my server ip where I put my web service but I want to get my client IP address.

Can someone help me with this.

Thanks
Chandresh
[email protected]