如何根据C#.net中PC的MAC地址为一台PC制作软件? [英] how to make software for one PC depending on MAC address of PC in C#.net ?
本文介绍了如何根据C#.net中PC的MAC地址为一台PC制作软件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
你好先生。
i非常感谢你,因为我从你的博客那里得到了很多知识。
i有关于如何查询在c#中创建基于MAC地址的软件,因此可以使用一个PC(MAC)的一个软件副本。
i如果你能提供帮助,将全部感谢你我出去了。
谢谢:)来自msdn的
hello sir .
i am very thank full to you because i got very much knowledge from your blogs.
i have query about how to make MAC addresses based software in c# , so it can be use one software copy for one PC (MAC).
i will be thank full to you if you can help me out.
thank you :)
推荐答案
:
https://msdn.microsoft.com/en-us/library/ system.net.networkinformation.networkinterface.getphysicaladdress(v = vs.110).aspx [ ^ ]
from msdn:
https://msdn.microsoft.com/en-us/library/system.net.networkinformation.networkinterface.getphysicaladdress(v=vs.110).aspx[^]
public static void DisplayTypeAndAddress()
{
IPGlobalProperties computerProperties = IPGlobalProperties.GetIPGlobalProperties();
NetworkInterface[] nics = NetworkInterface.GetAllNetworkInterfaces();
Console.WriteLine("Interface information for {0}.{1} ",
computerProperties.HostName, computerProperties.DomainName);
foreach (NetworkInterface adapter in nics)
{
IPInterfaceProperties properties = adapter.GetIPProperties();
Console.WriteLine(adapter.Description);
Console.WriteLine(String.Empty.PadLeft(adapter.Description.Length,'='));
Console.WriteLine(" Interface type .......................... : {0}", adapter.NetworkInterfaceType);
Console.WriteLine(" Physical Address ........................ : {0}",
adapter.GetPhysicalAddress().ToString());
Console.WriteLine(" Is receive only.......................... : {0}", adapter.IsReceiveOnly);
Console.WriteLine(" Multicast................................ : {0}", adapter.SupportsMulticast);
Console.WriteLine();
}
}
哦,PS:这是你想要的物理地址;)
Oh, PS: it's the Physical Address you want ;)
这篇关于如何根据C#.net中PC的MAC地址为一台PC制作软件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文