qq82015930 发表于 2010-2-4 00:13:18

VBS转AU3怎么转??

if Num<10 then
Name="00"
else
if Num<100 then
Name="0"
else
Name=""


Set sh = Nothing
Set oShell = Nothing
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colNetAdapters = objWMIService.ExecQuery _
("Select * from Win32_NetworkAdapterConfiguration where IPEnabled=TRUE")
strIPAddress = Array("192.168.0."&Num)
strSubnetMask = Array("255.255.255.0")
strGateway = Array("192.168.0.1")
For Each objNetAdapter in colNetAdapters
errEnable = objNetAdapter.EnableStatic(strIPAddress, strSubnetMask)
errGateways = objNetAdapter.SetGateways(strGateway)

Dim dns
dns=Array("61.128.128.68","61.128.192.68")
err=objNetAdapter.SetDNSServerSearchOrder(dns)

ceoguang 发表于 2010-2-4 01:38:42

汉化版本身已经集成,参考ACN_NET.au3

bing614 发表于 2010-2-4 06:25:56

我来回复$colItems = ""
$strComputer = "localhost"
$objWMIService = ObjGet("winmgmts:\\" & $strComputer & "\root\CIMV2")
$colItems = $objWMIService.ExecQuery("SELECT * FROM Win32_NetworkAdapterConfiguration where IPEnabled=TRUE", "WQL", 0x10 + 0x20)
Local $strIPAddress = ["192.168.1.235"]
Local $strSubnetMask = ["255.255.254.0"]
Local $strGateway = ["192.168.1.1"]
Local $dns = ["202.96.128.80", "202.96.128.81"]
For $objItem In $colItems
        $objItem.EnableStatic($strIPAddress, $strSubnetMask)
        $objItem.SetGateways($strGateway)
        $objItem.SetDNSServerSearchOrder($dns)
Next
MsgBox(0,"","完成")

qq82015930 发表于 2010-2-4 15:34:56

谢谢,你们的回答,。:face (29):

menfan 发表于 2010-2-4 20:44:32

呵呵,学习一下。。
页: [1]
查看完整版本: VBS转AU3怎么转??