Get Client IP address

  • Thread starter Thread starter SA
  • Start date Start date
S

SA

Hi,



In my ASP.NET application I am using client IP, I was using

"Request.ServerVariables["REMOTE_ADDR"]" to get client IP. Now I moved my
servers to under Cisco content switch for load balancing. Now
"Request.ServerVariables["REMOTE_ADDR"]" and

"Request.UserHostAddress", both returning Content switch IP instead of
client IP. Is there any way I can get client IP from C# under load balancing
mode??

Thanks in Advance,

SA.
 
SA

You didn't say if you're using a web service or a web page. Please follow
the examples:

ASP.net page
=========
Response.Write(Request.UserHostAddress())

Web Service
=========
Context.Request.ServerVariables ["REMOTE_ADDR"]
 
Hi Robson, Thanks for the reply.



It's a web page. I tried both in the web page, both are returning Content
switch IP instead of client IP :(.

Thanks,
Sudheer.
Robson Siqueira said:
SA

You didn't say if you're using a web service or a web page. Please follow
the examples:

ASP.net page
=========
Response.Write(Request.UserHostAddress())

Web Service
=========
Context.Request.ServerVariables ["REMOTE_ADDR"]
--
Regards,
Robson Siqueira
Enterprise Architect
SA said:
Hi,



In my ASP.NET application I am using client IP, I was using

"Request.ServerVariables["REMOTE_ADDR"]" to get client IP. Now I moved my
servers to under Cisco content switch for load balancing. Now
"Request.ServerVariables["REMOTE_ADDR"]" and

"Request.UserHostAddress", both returning Content switch IP instead of
client IP. Is there any way I can get client IP from C# under load
balancing mode??

Thanks in Advance,

SA.
 
Back
Top