📜  随机mac地址c#代码示例

📅  最后修改于: 2022-03-11 14:48:57.749000             🧑  作者: Mango

代码示例1
public static string GetRandomMacAddress()
{
    var random = new Random();
    var buffer = new byte[6];
    random.NextBytes(buffer);
    var result = String.Concat(buffer.Select(x => string.Format("{0}:", x.ToString("X2"))).ToArray());
    return result.TrimEnd(':');
}