综合

c#中文gbk编码查询示例代码

网友投稿 2023-07-04 04:31:04

复制代码 代码如下:
private void button_Inquriy_Click(object sender, EventArgs e)
{
if (textBox_Inquiry.TextLength > 0)
{
String strInquiry = textBox_Inquiry.Text;
byte[] bytes = Encoding.GetEncoding("GB2312").GetBytes(strInquiry);
String strResult = String.Empty;
foreach (byte b in bytes)
{
strResult += b.ToString("X2");
strResult += " ";
}
textBox_Result.Text = strResult;
}
else
{
MessageBox.Show("请输入待查询的字符");
}
}

相关文章

  • 股票中xd是啥
  • 在线听书软件排行榜 好用的听书软件排行榜
  • 家庭信息箱有哪些布线方法 家庭信息箱的作用
  • 什么是电机逆变器,电机逆变器的功能和原理
  • 六稳六保的具体内容是什么
  • 发票联是什么
  • 中国银行联行号怎么查
  • 财政政策是什么
  • 听书软件排行榜 最好的听书app排名榜
  • 自动驾驶系统的定位方法有哪些,各有什么特点