VB获取本机IP地址
2023-1-7 乱云飞
Private Sub Command1_Click() strComputer = "." '//http://80c.cc Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2") Set IPConfigSet = objWMIService.ExecQuery("Select IPAddress from Win32_NetworkAdapterConfiguration where IPEnabled=TRUE") For Each IPConfig In IPConfigSet If Not IsNull(IPConfig.IPAddress) Then For i = LBound(IPConfig.IPAddress) To LBound(IPConfig.IPAddress) MsgBox "本机内网IP地址是:" & IPConfig.IPAddress(i) Next End If Next End Sub本文链接:http://80c.cc/ez/614.html
发表评论: