|
$OBJWMISERVICE = OBJGET("WINMGMTS:\\LOCALHOST\ROOT\CIMV2")
$COLITEMS = $OBJWMISERVICE.EXECQUERY("SELECT * FROM WIN32_NETWORKADAPTERCONFIGURATION WHERE
IPENABLED != 0", "WQL", 0X10 + 0X20)
IF ISOBJ($COLITEMS) THEN
FOR $OBJITEM IN $COLITEMS
DIM $BROADCASTINGADDRESS="",$SUBNETADDRESS=""
$IPSPLIT=STRINGSPLIT($OBJITEM.IPADDRESS(0),".")
$SUBNETSPLIT=STRINGSPLIT($OBJITEM.IPSUBNET(0),".")
NEXT
ENDIF
FOR $I=1 TO $IPSPLIT[0]
IF $I=$IPSPLIT[0] THEN
$BROADCASTINGADDRESS=$BROADCASTINGADDRESS&BITOR($IPSPLIT[$I],BITXOR($SUBNETSPLIT[$I],255))
$SUBNETADDRESS=$SUBNETADDRESS&BITAND($IPSPLIT[$I],$SUBNETSPLIT[$I])
ELSE
$BROADCASTINGADDRESS=$BROADCASTINGADDRESS&BITOR($IPSPLIT[$I],BITXOR($SUBNETSPLIT[$I],255))
&"."
$SUBNETADDRESS=$SUBNETADDRESS&BITAND($IPSPLIT[$I],$SUBNETSPLIT[$I])&"."
ENDIF
NEXT
$SUBNETADDRESS 是子网地址
$BROADCASTINGADDRESS 是广播地址
求解!! |
|