Dim IP,Name
Ip=Inputbox ("请输入IP")
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colNetAdapters = objWMIService.ExecQuery _
("Select * from Win32_NetworkAdapterConfiguration where IPEnabled=TRUE")
strIPAddress = Array(IP)
strSubnetMask = Array("255.255.255.224")
For Each objNetAdapter in colNetAdapters
errEnable = objNetAdapter.EnableStatic(strIPAddress, strSubnetMask)
Next
本文介绍了如何使用DimIP和Win32_NetworkAdapterConfiguration来实现网络配置,包括获取IP地址和子网掩码,并通过EnableStatic方法启用静态IP配置。
4621

被折叠的 条评论
为什么被折叠?



