byte[] to string 或 string to byte[] 經常使用於與 rs232 或 telnet 通訊使用,記錄下此語法便於需要使用到的時候可以查詢
Sample
string to byte[]
byte[] _Byte = System.Text.Encoding.Default.GetBytes(stringValue);
byte[] to string
string stringValue= System.Text.Encoding.Default.GetString(_Byte);