日期:2014-05-19  浏览次数:20717 次

如何将汉字转成字符数组?????????
比如将汉字   "粽 "   转成   "F4   D5 "

------解决方案--------------------
try System.Text.Encoding.Default.GetBytes(yourstring)
------解决方案--------------------
try

string test = "粽 ";
byte[] encodedBytes = new byte[test.Length * 2];
int iCount = Encoding.GetEncoding( "gb2312 ").GetBytes(test, 0, test.Length, encodedBytes, 0);
foreach (byte b in encodedBytes)
{
richTextBox2 .Text += Convert.ToString(b, 16) + " ";
}