源码网商城,靠谱的源码在线交易网站 我的订单 购物车 帮助

源码网商城

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

  • 时间:2022-07-13 04:00 编辑: 来源: 阅读:
  • 扫一扫,手机访问
摘要:c#中文gbk编码查询示例代码
[u]复制代码[/u] 代码如下:
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("请输入待查询的字符");      }  }
  • 全部评论(0)
联系客服
客服电话:
400-000-3129
微信版

扫一扫进微信版
返回顶部