Hello Friends,
Recently i got one request in which one of my client wants to get user`s MAC(Media Access Control) Address who access his website.
First of all let me tell you what is a MAC Address mean ?
A Media Access Control address (MAC address) is a unique identifier assigned to most network adapters or network interface cards (NICs) by the manufacturer for identification. A MAC address usually encodes the manufacturer’s registered identification number. It may also be known as an Ethernet Hardware Address (EHA), hardware address, adapter address, or physical address.MAC Addrees is unique address.
If you want to find out your computer`s mac address then simply open command prompt and type these two commands which will returns you mac address of your computer.
1) GETMAC
2) IPCONFIG/ALL
Here is the code that will returns mac address of any computer.
Imports System.Net.NetworkInformation
Public Function GetMACAddress() As String
Dim st As [String] = [String].Empty
For Each nic As NetworkInterface In NetworkInterface.GetAllNetworkInterfaces()
Dim ot As OperationalStatus = nic.OperationalStatus
If nic.OperationalStatus = OperationalStatus.Up Then
st = nic.GetPhysicalAddress().ToString()
Exit For
End If
Next
Return st
End Function
Enjoy the code if you will find out any kind of difficulties then please add comment on same article i will provide you solution for that.
Tags: Get MAC address in asp .net, Get MAC address of client`s computer
Hello ! I am Arjun Jadeja a Software Engineer by Profession. You can contribute and I will distribute your ideas through this site. Thanks and Enjoy
Leave a reply