登录
首页 » Windows开发 » 获得本机以及指定域名的ipv4和ipv6地址

获得本机以及指定域名的ipv4和ipv6地址

于 2022-07-04 发布 文件大小:10.20 MB
0 133
下载积分: 2 下载次数: 1

代码说明:

应用背景本代码可以用来实现获取本机以及指定域名的ipv4地址以及ipv6地址,代码分了两个c++文件,并非写在一起,使用时可以注释掉其中一个或是新建项目将其中一个c++文件剪切进去。关键技术 对于本地的ip地址我们只需要使用WinSocket继承的Berkeley Socket API里面的函数gethostbyname()通过名字获得主机信息,然后再显示出其ip地址即可,对于输出ipv6地址需将地址族改为AF_INET6.进一步得到ipv6地址。而要得到指定域名的ip地址时需要对一个地址同样使用gethostbyname()获得信息,再进行显示。

下载说明:请别用迅雷下载,失败请重下,重下不扣分!

发表评论

0 个回复

  • 网络监控软件Vc6
    网络监控软件Vc6 -Network monitor system, VC++6 source code.
    2022-02-09 21:32:58下载
    积分:1
  • 这是一个关于tree kernel 的文章,很有帮助。比较新的文章
    这是一个关于tree kernel 的文章,很有帮助。比较新的文章-This is an article on the tree kernel to deal with it. Relatively new article
    2022-05-27 09:22:34下载
    积分:1
  • 短信停送电后台服务程序(自动送短信oracle数据平台)
    短信停送电后台服务程序(自动发送短信oracle数据平台)
    2022-04-27 15:08:53下载
    积分:1
  • C++ Templates 完全导引 对于理解和编写C++程序有很大好处
    C++ Templates 完全导引 对于理解和编写C++程序有很大好处-C++ Templates complete guide to understand and prepare for the C++ Procedures can bring considerable benefits to
    2023-02-02 00:35:03下载
    积分:1
  • Very good website of a government, we can try, really good, let us look at it.
    很好的一个政府网站,大家可以试试,真的很不错的,大家看看吧。-Very good website of a government, we can try, really good, let us look at it.
    2022-03-16 23:33:38下载
    积分:1
  • 实例04
    实例04-定时发送消息-04-time messaging
    2023-06-10 18:45:18下载
    积分:1
  • 数据结构中关于四则运算的实验,主要涉及到栈的操作,在运行窗口中选择1,进入运算操作.输入你所想要的式子,注意负数不要参与运算,但式子能产生负数.式子例如:...
    数据结构中关于四则运算的实验,主要涉及到栈的操作,在运行窗口中选择1,进入运算操作.输入你所想要的式子,注意负数不要参与运算,但式子能产生负数.式子例如: 输入9*(8-6/2)+9/2然后按Enter键,可以得到式子的值是49.5. 或者输入9-10*2然后按Enter键,可以得到式子的值是-11. -Data structure on the four computing experiments, mainly related to the operation of the stack, in the run window, select one, enter the computing operation. Enter the formula you want to pay attention to the negative not to take part in computing, but the formula can produce negative. Style son such as: Enter the 9* (8-6/2)+ 9/2 and then press Enter key, you can get the formula value is 49.5. or enter a 9-10* 2 and then press Enter key, you can get the value of formula is-11.
    2022-03-17 18:39:04下载
    积分:1
  • Magnifier+Spotlight WPF Custom Control
    Here are two examples of custom control available in WPF-based Windows applications. Magnifier can zoom in on specific parts. Spotlight can only show specific parts. You can learn how to use generic themes in custom control. The picture below shows a screenshot.
    2022-11-29 14:20:03下载
    积分:1
  • 串行通信
    串口通信  元代码 通过测试 串口通信是指外设和计算机间,通过数据信号线 、地线、控制线等,按位进行传输数据的一种通讯方式。这种通信方式使用的数据线少,在远距离通信中可以节约通信成本,但其传输速度比并行传输低。 串口是计算机上一种非常通用的设备通信协议。大多数计算机(不包括笔记本电脑)包含两个基于RS-232的串口。串口同时也是仪器仪表设备通用的通信 请点击左侧文件开始预览 !预览只提供20%的代码片段,完整代码需下载后查看 加载中 侵权举报 打分 发表评论 暂无评论
    2022-01-24 09:25:27下载
    积分:1
  • pb in the MDI window display pictures and the contents of a method, it does not...
    pb提供了可在MDI窗口中显示图片及各种内容的一种方法,它既不需要API调用也不需要定制MDI窗口,它仅仅使用PB的一般编程技巧,你很容易就会弄明白它的原理:它不过是一个比较特殊的Sheet而已!它特殊在什么地方呢,还是你自己去看吧!-pb in the MDI window display pictures and the contents of a method, it does not need an API call does not need to customize MDI windows, it is only the general use of PB programming skills, you can easily find out the principle : it is a rather exceptional Sheet! Its special in any place, or look at your own!
    2023-04-11 18:25:04下载
    积分:1
  • 696516资源总数
  • 106446会员总数
  • 9今日下载