可能重複:
How do you convert Byte Array to Hexadecimal String, and vice versa, in C#?字符串轉換爲字節數組
是否possbile爲一個字符串的內容轉換成完全相同的方式爲一個字節數組?
例如:我有這樣的字符串:
string strBytes="0xab, 0xcd, 0xef, 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef, 0x01, 0x23, 0x45, 0x67, 0x89";
有沒有可以給我下面的結果,如果我通過strBytes它的任何功能。
Byte[] convertedbytes ={0xab, 0xcd, 0xef, 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef, 0x01, 0x23, 0x45, 0x67, 0x89};
這_question_包含一個函數來做到這一點。 http://stackoverflow.com/q/6889400/60761 –