[ Log On ]
< <


Posted By: P.R.S
11/4/2012 12:00:00 AM
language: MVC

1.Put this in .aspx

<%@ Import Namespace=" System.Net.NetworkInformation"%> above

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">

2. Put in Body tag


    var macAddress="";
  NetworkInterface[] nics = NetworkInterface.GetAllNetworkInterfaces();
  foreach (NetworkInterface adapter in nics)
      IPInterfaceProperties properties = adapter.GetIPProperties();
      string _temp = adapter.GetPhysicalAddress().ToString();
      if (!string.IsNullOrEmpty(_temp))
          macAddress = _temp;


and you print or call macAddress where you want .

Share Your Source Code or Article

Do you have source code, articles, tutorials, web links, and books to share? You can write your own content here. You can even have your own blog.

Submit now...