c#中文gbk編碼查詢示例代碼
更新時間:2013年12月26日 09:41:29 作者:
c#中文gbk編碼查詢示例,大家參考使用吧
復制代碼 代碼如下:
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("請輸入待查詢的字符");
}
}
相關(guān)文章
C#中構(gòu)造函數(shù)和析構(gòu)函數(shù)用法實例詳解
這篇文章主要介紹了C#中構(gòu)造函數(shù)和析構(gòu)函數(shù)用法,結(jié)合實例形式詳細分析了C#中構(gòu)造函數(shù)與析構(gòu)函數(shù)的原理、定義、使用方法與相關(guān)注意事項,需要的朋友可以參考下2016-06-06時間戳與時間相互轉(zhuǎn)換(php .net精確到毫秒)
本文給大家分享的時間戳與時間相互轉(zhuǎn)換(php .net精確到毫秒) ,感興趣的朋友一起學習吧2015-09-09