[原创]查看外网IP及注册表简单访问
Dim WSHPrivate Sub cmdGetIP_Click() 'cmdGetIP按钮,当然也可以是别的控件.
Set WSH = CreateObject("WScript.Shell")
ret = WSH.RegRead("HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\Tcpip\Parameters\Interfaces\{ECEF46F6-390A-4C5F-8399-91946F0B9ECA}\DhcpIPAddress")
GetIP=ret 'GetIP是text控件,当然print也可以.
End Sub
'返回值是0.0.0.0就是没连网.(至少XP下是这个样子.)
'太简单了,高手勿笑哦~