```c#
Random random = new Random();
return string.Format("{0}{1}:{2}{3}:{4}{5}:{6}{7}:{8}{9}:{10}{11}", new object[]
{
random.Next(0, 16).ToString("x"),
"6",
random.Next(0, 16).ToString("x"),
random.Next(0, 16).ToString("x"),
random.Next(0, 16).ToString("x"),
random.Next(0, 16).ToString("x"),
random.Next(0, 16).ToString("x"),
random.Next(0, 16).ToString("x"),
random.Next(0, 16).ToString("x"),
random.Next(0, 16).ToString("x"),
random.Next(0, 16).ToString("x"),
random.Next(0, 16).ToString("x")
}).ToLower();
```
rand.Int 随机值
fmt.Sprintf 格式化字符串
具体使用方法查API吧
https://gowalker.org/math/rand#Int
https://gowalker.org/fmt#Sprintf
#3
更多评论
<a href="/user/hshd123" title="@hshd123">@hshd123</a> 是生成一组随机数字 mac,转换16进制
#2