2013-04-11 174 views
1

我有一個mac地址作爲字符串,格式如下:xx:xx:xx:xx:xx:xx(六個由冒號分隔的兩個十六進制數字組成的組)。將格式化的mac地址轉換爲十六進制值

我想將字符串轉換爲它各自的十六進制值(作爲System.Byte類型)。

我該如何轉換它?

回答

2

這個?評論後

"00:0a:fe:25:af:db" -split ':' | % { [byte]"0x$_" } 

編輯:

呢?

[UInt64] "0x$("00:0a:fe:25:af:db" -replace ':')" 
+0

我真的到了那麼遠,但我不知道如何將此列表轉換爲聯合十六進制值。 – iTayb 2013-04-11 11:23:38

+0

什麼是「十六進制值」? – 2013-04-11 11:25:12

+0

'$ x = 0x000afe25afdb' – iTayb 2013-04-11 11:26:13

相關問題