下面的程序可以实现远程开机(俺的网卡不支持,所以俺没有办法调试)unit Unit1;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, IdBaseComponent, IdComponent, IdUDPBase, IdUDPClient;type TForm1 = class(TForm) Button1: TButton; Edit1: TEdit; IdUDPClient1: TIdUDPClient; procedure Button1Click(Sender: TObject); private { Private declarations } public { Public declarations } end;var Form1: TForm1;implementation{$R *.dfm}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; IdUDPClient1.Send('255.255.255.255',80,Data); end;end.
007元素怎么跑这里来了
这篇文章应该发到20cn的阿
网卡是PCI
即插即用,不能控制到电源
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, IdBaseComponent, IdComponent, IdUDPBase, IdUDPClient;type
TForm1 = class(TForm)
Button1: TButton;
Edit1: TEdit;
IdUDPClient1: TIdUDPClient;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;var
Form1: TForm1;implementation{$R *.dfm}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; IdUDPClient1.Send('255.255.255.255',80,Data);
end;end.
这一句报错啊!
2。在BIOS内允许网卡唤醒
3。用软件(如AMD公司发布的Magic Packet 1.0)向此网卡发送唤醒信息(要用到MAC地址,IP地址是不行的)
http://school.enet.com.cn/document/20020225/2002022511011301.shtml
http://www.alphaweb.com.cn/netpub14.htm