Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个mac地址作为以下格式的字符串:(xx:xx:xx:xx:xx:xx六组两个十六进制数字,用冒号分隔)。
xx:xx:xx:xx:xx:xx
我想将字符串转换成它各自的十六进制值(作为一种System.Byte类型)。
System.Byte
我怎样才能转换它?
这个?
"00:0a:fe:25:af:db" -split ':' | % { [byte]"0x$_" }
评论后编辑:
[UInt64] "0x$("00:0a:fe:25:af:db" -replace ':')"