查找远程服务器的IP地址 [英] Find IP address of remote server
本文介绍了查找远程服务器的IP地址的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
亲爱的所有人,
我的服务器上有iframe,不同服务器从他们的页面调用。
我想匹配服务器IP地址和显示iframe内容。
我在下面使用代码 -
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-
Request.ServerVariables["SERVER_NAME"].ToString() + "<br/>");
Response.Write("Remote IP - " + Request.ServerVariables["remote_host"].ToString());
我没有收到远程IP地址。
SERVER_NAME - 提供主机服务器名称
remote_host - 在互联网上提供我的IP地址。 />
但是我想要远程服务器的IP地址
我怎么能得到它?
请帮帮我
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
推荐答案
你可以参考这篇CP帖子
如何在C#中获取远程计算机的IP地址 [ ^ ]
You can refer this CP post
How to get the IP address of Remote Computer in C#[^]
Var NowIP=String.Empty;
NowIP = HttpContext.Current.Request.ServerVariables["remote_addr"].ToString();
Response.Write(nowIP);
希望它能帮到你......
Hope it will help you.. .
这篇关于查找远程服务器的IP地址的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文