For smart Primates & ROBOTS (oh and ALIENS ).

Blogroll

Thursday, March 12, 2015

GET MAC ADDRESS IN C# VB.NET

Problem:

Some time you want to develop a software in C# or Vb.net that will run only on specific computer system. for this you use mac address of that system.

Solution:

Here the C# code that will fetch mac address.

Example:

System.Net.NetworkInformation.NetworkInterface[] nic= System.Net.NetworkInformation.NetworkInterface.GetAllNetworkInterfaces();
String macAddress = string.Empty;
foreach (System.Net.NetworkInformation.NetworkInterface ni in nic)
{
   System.Net.NetworkInformation.IPInterfaceProperties properties=ni.GetIPProperties();
   macAddress = ni.GetPhysicalAddress().ToString();
   if (macAddress != String.Empty) {
                        MessageBox.Show(macAddress);
                        return;
   } 

}



Share:

0 comments:

Post a Comment

Unable to resolve <website url> Try checking the for validity Google Pagespeed Insights

Unable to resolve <website url> Try checking the for validity Google Pagespeed Insights   You have a website and want to test it'...

Ads Inside Post

Powered by Blogger.

Arsip

Blog Archive