远程开机的数据为16进制,怎么写?
远程开机的数据为16进制,比如:网卡mac16进制为11 22 33 44 55 66 ,则开机数据包是:FF FF FF FF FF FF 11 22 33 44 55 66 11 22 33 44 55 66 11 22 33 44 55 66 11 22 33 44 55 66 11 22 33 44 55 66 11 22 33 44 55 66 11 22 33 44 55 66 11 22 33 44 55 66 11 22 33 44 55 66 11 22 33 44 55 66 11 22 33 44 55 66 11 22 33 44 55 66 11 22 33 44 55 66 11 22 33 44 55 66 11 22 33 44 55 66 11 22 33 44 55 66 这样的数据包怎么写? 善用搜索啊..$IPAddress = "192.168.0.255"; 广播地址!
$MACAddress = "00E04C02AD12";;MAC地址
_SendPacket($MACAddress)
Func _SendPacket($MACAddress)
UDPStartUp()
$connexion = UDPOpen($IPAddress, 7) ;prot 7 or 9
$res = UDPSend($connexion, GenerateMagicPacket($MACAddress))
MsgBox(0, "", $res)
UDPCloseSocket($connexion)
UDPShutdown()
EndFunc
Func GenerateMagicPacket ($sMAC)
Local $MagicPacket = Binary("0xFFFFFFFFFFFF"), $MACData = Binary("0x" & $sMAC)
For $i = 1 To 16
$MagicPacket &= $MACData
Next
Return $MagicPacket
EndFunc
这是本论坛上关于远程唤醒(开机)的最好的代码, 含原理!
http://www.autoitx.com/forum.php?mod=viewthread&tid=16568&highlight=wol
页:
[1]