读C#开发实战1200例子记录-2017年8月14日11:20:38获取汉字编码值

 try
            {
                char chr = textBox1.Text[0];
                byte[] gb2312_bt = Encoding.GetEncoding("gb2312").GetBytes(new Char[] { chr });
                int n = (int)gb2312_bt[0] << 8;
                n += (int)gb2312_bt[1];
                textBox2.Text = n.ToString();
            }
            catch(Exception)
            {
                MessageBox.Show("请输入汉字字符!","出现错误!");
            }


获取汉字编码值
原文地址:https://www.cnblogs.com/landv/p/7356782.html