查找FTP站点的IP地址和位置 [英] find IP address and location of FTP sites

查看:656
本文介绍了查找FTP站点的IP地址和位置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

朋友们,

我试图找出FTP站点的IP地址,ISP名称(互联网服务提供商)和位置.现在,我很难找到FTP站点的IP地址.
例如

< pre lang ="c#"> System.Net.IPAddress [] sIPAddress = null;
sIPAddress = System.net.Dns.GetHostAddresses("ftp://www.codeproject.com");</pre>


会引发一些错误
无法隐式转换类型"System.Net.IPAddress []""

有没有可能找到用于FTP站点的IP地址的解决方案,并且有任何方法可以找到该IP地址的ISP名称和位置.任何解决方案都将不胜感激.

问候,
sasi

Hi friends,

i am trying to find out the IP address,ISP name (internet service provider) and Location of the FTP site.Now, i am in trouble with to find ip address for FTP site.
for example

<pre lang="c#">System.Net.IPAddress[] sIPAddress = null;
sIPAddress= System.net.Dns.GetHostAddresses("ftp://www.codeproject.com");</pre>


it raise some error
Cannot implicitly convert type ''System.Net.IPAddress[]'' "

is there any possible solutions to find IP address for FTP sites and there is any way to find the ISP name and location for that IP address. any solutions could appreciated.

regards,
sasi

推荐答案

您没有在上面传递主机名,这是该方法所要查找的.

ftp://是协议,不是主机名的一部分.上面的代码仅适用于"www.codeproject.com",但是您不能确定是否有IP地址.

如果您很幸运-也就是说,如果ftp的主机名确实是"ftp",并且您可以猜测它们将使用的端口-那么您可以编写一些nslookup [ ^ ]代码,并获取域的主机名列表.

如果主机名中出现"ftp",则可以在上面的代码中查找(减去"ftp://").

最后,对于ISP和地址,您需要使用ARIN进行查找.

干杯.
You''re not passing in a host name above, which is what the method is looking for.

ftp:// is the protocal, not part of the host name. The above code will work with just "www.codeproject.com", but you can''t be sure that there is an IP address.

If you''re lucky - that is to say, if the host name for ftp is indeed "ftp" and you can guess the port they would be using - then you write some nslookup[^] code and get the list of hostnames for the domain.

If "ftp" appears in the hostname you could look that up with your code above (less the "ftp://").

Finally, for the ISP and address you''ll need to look that up with ARIN.

Cheers.


这篇关于查找FTP站点的IP地址和位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆