IP地址

所属分类:Windows编程
开发工具:Visual Basic
文件大小:2KB
下载次数:0
上传日期:2020-10-27 14:26:37
上 传 者徐瑞亭
说明:  VB Socket获取主机名和IP地址,获取主机名是使用了VB中的GetComputerName直接得到,然后对Socket初始化,使用gethostbyname取得主机地址,再获取到IP后进行转化为标准的IP格式。转换过程如下:   RtlMoveMemory host, hostent_addr, LenB(host)   RtlMoveMemory hostip_addr, host.hAddrList, 4   ReDim temp_ip_address(1 To host.hLength)   RtlMoveMemory temp_ip_address(1), hostip_addr, host.hLength   For i = 1 To host.hLength    ip_address = ip_address & temp_ip_address(i) & "."   Next i   ip_address = Mid$(ip_address, 1, Len(ip_address) - 1)   MsgBox "IP:" + ip_address
(VB socket gets the host name and IP address. The host name is obtained directly by using getcomputername in VB. Then the socket is initialized, and the host address is obtained by gethostbyname. After obtaining the IP, it is converted into the standard IP format.)

文件列表:
MSSCCPRJ.SCC (190, 2008-08-29)
工程1.VBP (699, 2020-10-27)
工程1.vbw (79, 2013-05-25)
Form1.frm (3735, 2020-10-27)
Module1.bas (1402, 2003-10-12)

近期下载者

相关文件


收藏者