sendarp 在哪个DLL中?
DELPHI中怎么申明?怎么用?能不能给一个例子?

解决方案 »

  1.   

    VC版http://www.pcvc.net/category/content.asp?sendid=229在IPHLPAPI.DLL中
    Delphi版:http://users.pandora.be/sonal.nv/ics/faq/General.html===================================Example 2: const INADDR_NONE = $FFFFFFFF; 
    function SendARP( const DestIP : DWord;
                      const SrcIP : DWord;
                      const pMacAddr : Pointer;
                      const PhyAddrLen : PULONG) : DWord; stdcall; external 'IPHLPAPI.DLL' name 'SendARP';function inet_addr(const cp : PChar) : DWord; stdcall; external 'WS2_32.DLL' name 'inet_addr';var
    dwResult : DWord;
    ulIPAddr : DWord;
    ulMACAddr : Array [0..5] of Byte;
    ulAddrLen : ULONG;begin
      ulIPAddr := inet_addr(PChar('192.168.1.1'));
      ShowMessage(IntToHex(ulIPAddr,8)); // Ist mal interessant zu sehen
      if ulIPAddr = INADDR_NONE exit;
      ulAddrLen := 6;
      dwResult := SendARP(ulIPAddr,0,@ulMACAddr,@ulAddrLen);
      ShowMessage('dwResult: '+IntToStr(dwResult)); // if 0, then ok
      ShowMessage(IntToHex(ulMACAddr[0],2)+':'+
                  IntToHex(ulMACAddr[1],2)+':'+
                  IntToHex(ulMACAddr[2],2)+':'+
                  IntToHex(ulMACAddr[3],2)+':'+
                  IntToHex(ulMACAddr[4],2)+':'+
                  IntToHex(ulMACAddr[5],2));
    end;