Delphi: Get MAC of Router
Posted
by
Daniel Marschall
on Stack Overflow
See other posts from Stack Overflow
or by Daniel Marschall
Published on 2010-12-29T00:36:42Z
Indexed on
2010/12/29
1:54 UTC
Read the original article
Hit count: 918
Hello,
I am using Delphi and I want to determinate the physical MAC address of a network device in my network, in this case the Router itself.
My code:
var
idsnmp: tidsnmp;
val:string;
begin
idsnmp := tidsnmp.create;
try
idsnmp.QuickSend('.1.3.6.1.2.1.4.22.1.2', 'public', '10.0.0.1', val);
showmessage(val);
finally
idsnmp.free;
end;
end;
where 10.0.0.1 is my router.
Alas, QuickSend does always send "Connection reset by peer #10054". I tried to modify the MIB-OID and I also tried the IP 127.0.0.1 which connection should never fail. I did not find any useable Tutorials about TIdSNMP at Google. :-(
Regards Daniel Marschall
© Stack Overflow or respective owner