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

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

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

代码说明:

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

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

发表评论

0 个回复

  • 后台监控客户端信息
    windows 后台服务程序, 监控客户端 ip 信息数据 写文件保存日志
    2023-02-02 06:55:04下载
    积分:1
  • 国外结构计算程序,FORTRAN高级语言编写,主要用于结构分析。...
    国外结构计算程序,FORTRAN高级语言编写,主要用于结构分析。-abroad structure calculation procedures, the High FORTRAN language, mainly for structural analysis.
    2022-02-05 22:50:48下载
    积分:1
  • since the emergence of the Windows operating system. the application process for...
      自从Windows操作系统出现以后,在应用程序中进行人机交互的思想和手段便发生了根本性的改变,计算机的界面变得友好精彩。一个程序的好坏很大程 度上决定于人机交互的方便程度。当前,大多数程序的标题栏都千篇一律,如何让自己的程序与众不同是每个程序员的梦想,但改变标题栏的内容的确有相当的难 度。该篇文章向你介绍如何在标题栏上添加图标按钮,而且当鼠标经过和点击该图标时,鼠标将有不同的反应。请按照下面的步骤实现。   第一步:打开VC编程环境,生成一个新的基于单文档的工程temp,所有的选项都取默认值,下面,我们就在此工程的标题栏上生成三个按钮图标。   第二步:下载资源文件,共有三个文件:CaptionButton.cpp、CaptionButton.h和Thunk.h。将这三个文件添加到工程中(添加方法不必细说了吧)。 -since the emergence of the Windows operating system. the application process for HCI thinking and means has undergone a fundamental change, computer-friendly interface become brilliant. The quality of a process largely depends on the man-machine interaction convenience. Currently, the majority of procedures are stereotyped column heading, and how to help their own procedures are different for each programmer"s dream, but to change the column headings as indeed it is quite difficult. The article to tell you how to add Biaodilanshang icon button, but when the mouse hovers over the icon and click, mouse will have d
    2022-03-19 19:08:12下载
    积分:1
  • 此程序的目的是为了叠加不同的图形使之显示。
    此程序的目的是为了叠加不同的图形使之显示。-The purpose of this procedure is different in order to overlay graphics to make it show.
    2023-06-20 05:30:03下载
    积分:1
  • source code for VC learning
    vc学习的源代码-source code for VC learning
    2022-04-12 09:34:53下载
    积分:1
  • AT91SAM9260(ARM926EJ
    AT91SAM9260(arm926ej-s)bootloader的源代码-AT91SAM9260 (arm926ej-s) bootloader source code
    2022-07-23 09:52:13下载
    积分:1
  • do with Delphi database applications as simple Although there is no complete sof...
    用Delphi做数据库应用就这么简单 虽然是个没有全部完成的软件,但数据库的插入、查找、更新等等有了,初学者可以看看,呵! 源代码中的打印及查询部分只是包括一些测试时使用的代码,我在了解如何实现打印及查询后就没有继续做下去。这两个部分可以根据不同的需求修改。-do with Delphi database applications as simple Although there is no complete software, but database insert, retrieve, update, etc. With that beginners can see, uh! The source code for the print and inquiries, including some part is the use of the test code, I understand how to achieve Print and inquiries had not continue to do so. These two parts can be based on different needs revision.
    2022-09-02 19:10:03下载
    积分:1
  • 中文分词: 输入一个汉字的文本文件,可将里面的汉字分解成一个个符合人们心理的词...
    中文分词: 输入一个汉字的文本文件,可将里面的汉字分解成一个个符合人们心理的词-Chinese word : a Chinese character input text files can be inside of a Chinese character is divided into 000 people with mental word
    2022-05-20 13:38:35下载
    积分:1
  • 包含信息的采集系统(当前用户、存储信息,…
    一个包含获取系统信息(当前用户,内存信息,硬盘序列号,操作系统版本,计算机名,IP地址等)函数的pas文件,其中含有应用各函数方法的例子!-Acquisition system that contains information (current user, memory information, hard drive serial number, operating system version, computer name, IP address, etc.) function of the pas file, which contains application examples of the function!
    2023-02-17 04:45:04下载
    积分:1
  • 一些简单的C编程实例,初学C者可以参考,应该挺有用。
    一些简单的C编程实例,初学C者可以参考,应该挺有用。-Some simple examples of C programming, learning C will be able to reference, it should be quite used.
    2023-02-24 04:10:03下载
    积分:1
  • 696516资源总数
  • 106914会员总数
  • 0今日下载