你说:网络唤醒的消息定义是:前面6个字节的FF,然后重复16遍Mac地址(地址为12字节)
是那样的吗?网络唤醒 是你的机器休眠时网卡收到数据包而停止休眠
Mac地址 不是 12 字节的,而是 6 字节的, 比如在win2000下执行 arp -a 得到
Interface: 192.141.140.15 on Interface 0x1000005
  Internet Address      Physical Address      Type
  192.141.140.1         00-80-c8-94-49-59     dynamic
  192.141.140.3         00-20-af-ba-c5-18     dynamic00-80-c8-94-49-59 就是 6 字节的 mac address 用 16 进制表示。

解决方案 »

  1.   

    最开始的是这样的~~~~~但怎么不能实现网络唤醒呢~~procedure TFunc.PowerMachine(aMac: String;NMUDP1:TNMUDP);
    var Str:Array[1..103] of Char;
        i:Integer;
      function StrtoHex(S:String):Byte;
      begin
        Result := 0;
        Case S[2] of
         '0': Result := 0;
         '1': Result := 1;
         '2': Result := 2;
         '3': Result := 3;
         '4': Result := 4;
         '5': Result := 5;
         '6': Result := 6;
         '7': Result := 7;
         '8': Result := 8;
         '9': Result := 9;
         'A': Result := 10;
         'B': Result := 11;
         'C': Result := 12;
         'D': Result := 13;
         'E': Result := 14;
         'F': Result := 15;
         end;
        Case S[1] of
         '0': Result := Result;
         '1': Result := Result + 16*1;
         '2': Result := Result + 16*2;
         '3': Result := Result + 16*3;
         '4': Result := Result + 16*4;
         '5': Result := Result + 16*5;
         '6': Result := Result + 16*6;
         '7': Result := Result + 16*7;
         '8': Result := Result + 16*8;
         '9': Result := Result + 16*9;
         'A': Result := Result + 16*10;
         'B': Result := Result + 16*11;
         'C': Result := Result + 16*12;
         'D': Result := Result + 16*13;
         'E': Result := Result + 16*14;
         'F': Result := Result + 16*15;
         end;
       end;
    begin
      for i := 1 to 6 do  Str[i] := #255;
      i := 7;
      while i < 103 do
      begin
       Str[i]   := chr(StrToHex(Copy(aMac,1,2)));
       Str[i+1] := chr(StrToHex(Copy(aMac,3,2)));
       Str[i+2] := chr(StrToHex(Copy(aMac,5,2)));
       Str[i+3] := chr(StrToHex(Copy(aMac,7,2)));
       Str[i+4] := chr(StrToHex(Copy(aMac,9,2)));
       Str[i+5] := chr(StrToHex(Copy(aMac,11,2)));
       inc(i,6);
      end;
      NMUDP1.LocalPort := 0;
      NMUDP1.RemotePort := 0;
      NMUDP1.RemoteHost := Copy(GetFormatIP(GetLocalIP),1,12)+'255';
      NMUDP1.ReportLevel := 1;
      NMUDP1.SendBuffer(Str,103);
    end;到底var Str:Array[1..103] of Char;是不是正确的呢~~~~
    那么Mac地址应该是6字节重复16次咯?谁还有回帖的话,我再另开贴给分哦,谢谢先~~~~~~~~~