Click here to Skip to main content
15,891,939 members
Please Sign up or sign in to vote.
4.38/5 (3 votes)
See more:
Dear All,

I have iframe on my server which is called by different server from their page.
I want to match server IP address and display iframe content.



I am using below code-

XML
Request.ServerVariables["SERVER_NAME"].ToString() + "<br/>");
       Response.Write("Remote IP - " + Request.ServerVariables["remote_host"].ToString());



I am not getting remote IP address.
SERVER_NAME - provides host server name
remote_host - gives my ip address on internet.

But i want ip address of remote server
How can i get that?
Please help me out
Posted
Updated 12-Feb-14 1:26am
v2

 
Share this answer
 
C#
Var NowIP=String.Empty;

NowIP = HttpContext.Current.Request.ServerVariables["remote_addr"].ToString();
Response.Write(nowIP);


Hope it will help you.. .
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900