Just started looking at this bit of code - think it holds the key. Since the SendData method takes a string, then this routine is somehow constructing a string containing nulls ?
Whats with the sixteen times mac address thingy ? Is that part of the trick or just something to do with WOL ?
code:
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' Function: CreatePacket
' Params: array of bytes representing Mac address of target
' Return: String of data representing Magic Packet data
' Notes: Magic Packet is six bytes of chr(&HFF) folowed by 16 copies of the target adapter's
' Mac address
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Private Function CreatePacket(arMacAddr)
Dim Item
Dim strTemp
Dim strData
For Each Item in arMacAddr
Item = "&H" & Item
strTemp = strTemp & chr(Item)
Next
For i = 1 to 16
strData = strData & strTemp
Next
CreatePacket = String(6, &HFF) & strData
End Function
[ 19. August 2003, 01:07: Message edited by: Shawn ]