الى خبراء الدلفي :
كيفية .. الحصول على ال MAC Address بمعرفة ال IP لجهاز على الشبكة
كيف يتم ذلك بارك الله فيكم.
الى خبراء الدلفي :
كيفية .. الحصول على ال MAC Address بمعرفة ال IP لجهاز على الشبكة
كيف يتم ذلك بارك الله فيكم.
السلام عليكم
أخ activeman هل صرت مبرمج دلفي أيضا !!! :D
على كل للحصول علىMAC address بإعتماد على العنوان IPبإمكانك إستعمال الدالةSendARP المعرفة في IPHLPAPI.dllبالشكل التالي ;)
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;هذا الموضوع مغلق.
المتواجدون خلال آخر دقيقتين · يتحدّث كل ٣٠ ثانية
جارٍ التحقق من المتواجدين…