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

1707608857662.png
 

Attachments

  • 1707608790377.png
    1707608790377.png
    14.6 KB · Views: 28

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:
1707610189201.png


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

Peter Lewis

Active Member
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:
View attachment 150684

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