手机
当前位置:查字典教程网 >编程开发 >C#教程 >c#中文gbk编码查询示例代码
c#中文gbk编码查询示例代码
摘要:复制代码代码如下: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#中文gbk编码查询示例代码】相关文章:

C# 创建文本文件写入读取实现代码

c#获取本机的IP地址的代码

c#中返回文章发表的时间差的示例

c# 调用.bat文件的实现代码

C#编写Windows服务实例代码

C#.net中的类型转换详细介绍

c#初学简单程序实例代码介绍

使用 C# 动态编译代码和执行的代码

C#中方括号[]的语法及作用介绍

C#编写的windows计算器的实例代码

精品推荐
分类导航