vbs如何判断内网外网
1个回答
展开全部
on error resume next
ip1 = createobject("rcbdyctl.Setting").GetIPAddress
ip2 = createobject("mswinsock.winsock").localip
strComputer = "."
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 UBound(IPConfig.IPAddress)
ip3 = IPConfig.IPAddress(i)
Next
End If
Next
msgbox ip1 & vbcrlf & ip2 & vbcrlf & ip3
if left(ip3,7) = "192.168" then msgbox "内网" else msgbox "外网"
ip1 = createobject("rcbdyctl.Setting").GetIPAddress
ip2 = createobject("mswinsock.winsock").localip
strComputer = "."
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 UBound(IPConfig.IPAddress)
ip3 = IPConfig.IPAddress(i)
Next
End If
Next
msgbox ip1 & vbcrlf & ip2 & vbcrlf & ip3
if left(ip3,7) = "192.168" then msgbox "内网" else msgbox "外网"
Storm代理
2023-07-25 广告
2023-07-25 广告
StormProxies是一家国内优质海外HTTP代理商,拥有一个庞大的IP资源池,覆盖200多个地区,IP数量大且匿名度高。其优点还包括超高并发、稳定高效、技术服务等特点,同时提供HTTP、HTTPS以及SOCKS5协议支持。此外,Sto...
点击进入详情页
本回答由Storm代理提供
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询