Get Client IP address

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.
 
R

Robson Siqueira

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"]
 
S

SA

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top