将字符转换为字节:
byte[] byteTime = Encoding.ASCII.GetBytes(DateTime.Now.ToString());
将字节转换为字符:
string sTime = Encoding.ASCII.GetString(bytes,0,bytesRead);
文章来源:
http://my.donews.com/robinchow/2007/03/25/c-%e4%b8%ad%e5%ad%97%e7%ac%a6%e5%92%8c%e5%ad%97%e8%8a%82%e7%9b%b8%e4%ba%92%e8%bd%ac%e6%8d%a2/