B4J Question [SOLVED] MAC addresses of Devices on my Subnet

Peter Lewis

Active Member
Licensed User
Longtime User
Hi All

I am looking for a way to get all the MAC addresses on a subnet that this Windows PC is on.

I have seen the code on the forum to be able to get from the PC that is running the program.

Other programs can do it but i want to integrate it into my program

eg , this is one of my internal subnets at home using Advanced IP scanner

Thank you

 

Attachments

  • 1707608790377.png
    14.6 KB · Views: 87

Daestrum

Expert
Licensed User
Longtime User
NonUI program code
B4X:
Sub AppStart (Args() As String)
    Dim sh As Shell
    sh.Initialize("sh","arp",Array("-a "))
    sh.Run(2000)
    StartMessageLoop
End Sub

Sub sh_ProcessCompleted (Success As Boolean, ExitCode As Int, StdOut As String, StdErr As String)
    Log(Success)
    Log(StdOut)
    Log("-------Err-------")
    Log(StdErr)
End Sub

Gives:


(why does the windows snipping tool make such big pictures???)
 
Upvote 0

Peter Lewis

Active Member
Licensed User
Longtime User
Thank you
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…