我在用wmi module
x = wmi.WMI().Win32_NetworkAdapterConfiguration(index=9)
// this index for my tap drive
并更改界面内的属性,它不会在界面中更改
nic = x[0]
nic.properties['NetEnabled'] = True
//it still gives False in the interface when i see it again
即使我无法分配 IP 地址、网关和子网掩码
我试过了
c = t.ExecQuery("select * from Win32_TapDrive where NetConnectionID='Local Area Connection'")
//It gives unknown object i can't deal with it
请提供任何帮助。
我正在使用windows环境。