如何在Windows下使用C中的ipaddress查找主机名 [英] How to find the hostname by using ipaddress in c under windows

查看:87
本文介绍了如何在Windows下使用C中的ipaddress查找主机名的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

先生,我知道局域网中连接的远程系统的IP地址(使用getpeername()).
我想知道远程系统的IP地址.
您能帮我吗?

sir i know the ip address of the remote system(using getpeername()) that are connected in the LAN..

i want to know the IP Address of the remote system..

can you help me...

推荐答案

您需要以IP地址或主机名开头;没有一些信息,您就无法找到姓名或地址.如果您知道子网,则可以尝试连接到子网中的每个地址.看看 Winsock2 [
You need to start with either the IP address or hostname; there is no way to find a name or address without some information to get you started. If you know the subnet then you could possibly try connecting to each address on the subnet. Take a look at the Winsock2[^] documentation for more help.


这篇关于如何在Windows下使用C中的ipaddress查找主机名的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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