...realize a Wake on Lan? (Magic Packet)
Author: Jailbird
{
What's a Magic Packet?
Was ist ein Magic Packet?
DESTINATION SOURCE MISC. 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 MISC. CRC.
Note: Destination, Source, Misc and CRC are normally added by our Socket-Component
Beachte: Destination, Source, Mis und CRC werden normalerweise von deiner
Socket-Komponente hinzugefügt
}
procedure TForm1.Button1Click(Sender: TObject);
var
Data, temp: string;
k, n: integer;
begin
Data := '';
for k := 0 to 5 do
begin
Data := Data + Chr(StrToInt('$FF')); // 6x add a FF / 6x ein FF hinzufügen
end;
temp := StringReplace(Edit1.Text, '-', '', [rfReplaceAll]);
for k := 0 to 15 do
begin
temp := StringReplace(Edit1.Text, '-', '', [rfReplaceAll]);
for n := 0 to 5 do
begin
// 16x add Target-Mac-Adress / 16x die Ziel-Macadresse hinzufügen
Data := Data + Chr(StrToInt('$' + temp[1] + temp[2]));
Delete(temp, 1, 2);
end;
end;
//Example with TIdUDPClient of Indy
//IdUDPClient1.Send('255.255.255.255', '80', Data); // Send it / Verschick es
end;
printed from
www.swissdelphicenter.ch
developers knowledge base