0

Display all ip and mac address in same wifi connection

As I have tried to use cmd and enter "arp -a" to show all ip and MAC address.

I would like to do something like this on ASP.NET MVC C# to show all IP and MAC address on web Is it possible? If yes how to do it for easily thank you :)

svick
  • 236,525
  • 50
  • 385
  • 514
anin
  • 115
  • 2
  • 9
  • possible duplicate of [how can I get list of active LAN user using ARP](http://stackoverflow.com/questions/20707604/how-can-i-get-list-of-active-lan-user-using-arp) – CodeCaster Jul 08 '14 at 21:43
  • Do you want to show all addresses on the same network as the *client* (i.e. browser) or the *server*? – svick Jul 15 '14 at 19:58

2 Answers2

-2

To show the IP address in C# :

    string strHostName = System.Net.Dns.GetHostName();
    string clientIPAddress = System.Net.Dns.GetHostAddresses(strHostName).GetValue(1).ToString();

    TextBox1.Text = clientIPAddress;

After you got your IP address , the below link should help you to get the MAC address

How do I obtain the physical (MAC) address of an IP address using C#?

Community
  • 1
  • 1
  • 1
    I already got my IP and MAC address. but what I want is to get IP and MAC address form the other client in the same wifi. but thank far answer anyways :) – anin Jul 08 '14 at 06:58
-2

Use the System.Diagnostics functionality to execute the arp -a command and parse through the results.

There is a blog that addresses how to do this here: http://pietschsoft.com/post/2009/11/08/Resolve_IP_Address_And_Host_Name_From_MAC_Address_using_CSharp_and_Windows_ARP_Utility

papadoo
  • 127
  • 3