综合

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("请输入待查询的字符");
}
}

相关文章

  • 笔记本电脑风扇怎么清理
  • 三大财政政策包括什么
  • 权重是什么
  • 市盈率计算公式是什么
  • 外汇头寸是什么意思
  • 招行贷款产品有哪些
  • 微信转账限额多少
  • 固态电池概念股有什么
  • 借记卡和信用卡区别是什么
  • 购物软件app排行榜前十名,手机购物app排行前十名