VB6.0
需要引用Microsoft WMI Scripting
代码为了便于修改,IP未做处理
初衷(当前代码)只改默认网关
192.168.199.200和192.168.199.253之间切换
Dim pd
Dim lip
Option Explicit '这是窗体代码
Private Sub Command3_Click()
pd = 1
MsgBox ChangeIP("1", "255.255.255.0", "192.168.1.1", "202.98.192.67", "202.98.198.167")
End Sub
Private Sub Command4_Click()
pd = 2
MsgBox ChangeIP("1", "255.255.255.0", "192.168.1.1", "202.98.192.67", "202.98.198.167"