12345678910111213141516171819202122232425262728 |
- using System;
- using System.Collections.Generic;
- using System.Text;
- using System.Text.RegularExpressions;
- namespace Vinno.vCloud.Common.License.Licenses
- {
- //本地CPUID和MAC地址的获取
- static class GetLocalInfo
- {
- /// <summary>
- /// 获取本机MAC地址
- /// </summary>
- /// <returns>本机MAC地址</returns>
- public static string GetMacAddress()
- {
- string macAddress = string.Empty;
- var macList = System.Net.NetworkInformation.NetworkInterface.GetAllNetworkInterfaces();
- foreach (System.Net.NetworkInformation.NetworkInterface nic in macList)
- {
- macAddress += "-" + nic.GetPhysicalAddress();
- }
- return macAddress;
- }
- }
- }
|