综合

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排名前十
  • 基金定投是什么
  • 购物软件app排行榜前十名,手机购物app排行前十名
  • 游资是什么意思?游资和主力怎么区分?
  • 十大谍战剧排名推荐 近三十年10佳经典谍战电视剧
  • 大学生如何理财
  • 期货豆一和豆二区别是什么