c#中文gbk编码查询示例代码_C#教程-查字典教程网
c#中文gbk编码查询示例代码
c#中文gbk编码查询示例代码
发布时间:2016-12-28 来源:查字典编辑
摘要:复制代码代码如下:privatevoidbutton_Inquriy_Click(objectsender,EventArgse){if(t...

复制代码 代码如下:

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

}

}

相关阅读
推荐文章
猜你喜欢
附近的人在看
推荐阅读
拓展阅读
  • 大家都在看
  • 小编推荐
  • 猜你喜欢
  • 最新C#教程学习
    热门C#教程学习
    编程开发子分类