This code gives MAC address of my PC but I want to find the MAC addresses of those mobile or computer devices who are connected to my wifi hotspot.
string mac = "";
foreach (NetworkInterface nic in NetworkInterface.GetAllNetworkInterfaces())
{
if (nic.OperationalStatus == OperationalStatus.Up &&
(!nic.Description.Contains("Virtual") && !nic.Description.Contains("Pseudo")))
{
if (nic.GetPhysicalAddress().ToString() != "")
{
mac = nic.GetPhysicalAddress().ToString();
}
}
}
MessageBox.Show(mac);
I want to do something similar, like perhaps the following pseudo-code:
string MAC;
//method for retrieving mac address of the connected devices to my hotspot.
ConnectedDevices()
{
// some code which will give you MAC of that device.
MAC = mac address of connected device;
}
label1.text=mac.toString();
Thanks!