且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何将ASP.NET应用程序与系统绑定,从而无法从一个系统复制到另一个系统

更新时间:2023-11-27 21:52:34

你可以测试你的macaddress:

You can test your macaddress:
public bool MacAddressOk(string myMacAddress)
{
  string macAddresses = "";
  foreach (System.Net.NetworkInformation.NetworkInterface nic in System.Net.NetworkInformation.NetworkInterface.GetAllNetworkInterfaces())
  {
    // We must consider only Ethernet network interfaces
    if (nic.NetworkInterfaceType != System.Net.NetworkInformation.NetworkInterfaceType.Ethernet) continue;
    if (nic.OperationalStatus == System.Net.NetworkInformation.OperationalStatus.Up)
    {
      macAddresses += nic.GetPhysicalAddress().ToString();
      break;
    }
  }
  if (macAddresses == myMacAddress)
    return true;
  else
    return false;
}