本帖最后由 hhasee 于 2009-6-25 10:24 编辑
代码的目的是提取MAC地址的后两位是不是EE,若是EE则会弹出带有MAC地址的对话框,但如何能让我点击“是”时执行FUCTION1(),点击否时执行fuction2(),请教高手如何解决?谢谢!原码如下:
$sky=mac()
Func mac()
$wbemFlagReturnImmediately = 0x10
$wbemFlagForwardOnly = 0x20
$colItems = ""
$strComputer = "localhost"
$Output=""
$objWMIService = ObjGet("winmgmts:\\" & $strComputer & "\root\CIMV2")
$colItems = $objWMIService.ExecQuery("SELECT * FROM Win32_NetworkAdapterConfiguration WHERE IPEnabled != 0", "WQL", _
$wbemFlagReturnImmediately + $wbemFlagForwardOnly)
If IsObj($colItems) then
For $objItem In $colItems
$Output1 = $Output & "" & $objItem.MACAddress & @CRLF
Next
Return $Output1
Else
Endif
EndFunc
$rmac=StringReplace($sky,":","")
$fid=StringMid ( $rmac, 11,2 )
if $fid = "EE" then MsgBox(4,"","请再次核实你的MAC地址: "&$rmac) |