文件名称:VB6.0 获取电脑IP地址(源码).rar
文件大小:2KB
文件格式:RAR
更新时间:2022-07-30 03:24:28
VB源码-网络相关
VB6.0 获取电脑IP地址(源码),获取本机所有IP地址,其实就是下面的代码来获取IP: Private Sub Command1_Click() Dim objWMI1 As Object, LOC1 As Object, X As Object, object1 As Object Dim IPA '定义对象和变量 Set objWMI1 = CreateObject("WbemScripting.SWbemLocator") '建立1个WBEM对象的引用指针 Set LOC1 = objWMI1.ConnectServer(".", "root\cimv2") '连接WMI Set X = LOC1.ExecQuery("SELECT * FROM Win32_NetworkAdapterConfiguration Where IPEnabled=1") For Each object1 In X IPA = object1.Properties_("IPAddress").Value '获取IP Picture1.Print IPA(I); '输出IP Picture1.Print Next End Sub
【文件预览】:
srcfans.com
----VB6.0 获取电脑IP地址(源码)()
--------Form1.frm(3KB)
--------E453.vbw(50B)
--------MSSCCPRJ.SCC(332B)
--------E453.vbp(684B)