再谈网络唤醒的问题
官方的UDF可能有问题,GenerateMagicPacket()中,$MACData 为空,$MagicPacket 为空
无法实现网络唤醒,
但下载专业的网络唤醒软件就可以哦.
$IPAddress = "172.16.1.255"; This is the broadcast address !
$MACAddress = "001122334455"
UDPStartUp()
$connexion = UDPOpen($IPAddress, 7)
$res = UDPSend($connexion, GenerateMagicPacket($MACAddress))
MsgBox(0, "", $res)
UDPCloseSocket($connexion)
UDPShutdown()
; ===================================================================
; Functions
; ===================================================================
; This function convert a MAC Address Byte (e.g. "1f") to a char
Func HexToChar($strHex)
Return Chr(Dec($strHex))
EndFunc
; This function generate the "Magic Packet"
Func GenerateMagicPacket($strMACAddress)
$MagicPacket = ""
$MACData = ""
For $p = 1 To 11 Step 2
$MACData = $MACData & HexToChar(StringMid($strMACAddress, $p, 2))
Next
MsgBox(0,"mac",$MACData) ;$MACData 为空
For $p = 1 To 6
$MagicPacket = HexToChar("ff") & $MagicPacket
Next
MsgBox(0,"magicpacket", $MagicPacket) ;$MagicPacket 为空
For $p = 1 To 16
$MagicPacket = $MagicPacket & $MACData
Next
MsgBox(0,"magicpacket1",$MagicPacket) ;$MagicPacket 为空
Return $MagicPacket
EndFunc
[ 本帖最后由 nodisk 于 2008-8-18 13:10 编辑 ] 还没有测试过。有时间测试一下。 这个很简单啊,把代码搞过去就能测~
一般笔记本电脑能支持网络唤醒~
三恨,测一下吧
还有没有人能测试的~?
还有没有人能测试的~? 没有测试啊? :face (21):还是没有人测试啊。我在等待结果 http://www.autoitx.com/forum.php?mod=viewthread&tid=148&extra=page%3D1&page=1 我测试了,唤不醒啊 :face (21):
页:
[1]