“my name” 的Unicode的十六进制是“6D00790020006E006D006500” 用C#代码怎么把 string aa="6D00790020006E006D006500";
转换成"my name"
转换成"my name"
解决方案 »
- 多表联合查询排序
- GridView 高手帮帮忙! 如何延长显示全部内容的层存在的时间 20+100
- 想把dataset里数据集存入数据库的问题。
- c#(winform)删除用combobox选择显示在datagridview中的表某一行的问题
- 关于给DataGridView中的下拉框(ComboBoxColumn)添加事件
- Asp.net(2003下)中无法使用streamwriter写文件???
- 请问 vs2010 在win7 64位上能运行c程序吗?
- 疯了,四天了!如何获取datagrid排序后当前选定行的数据?100分~
- IbatisNet 错误,高手 会的帮我看看!
- 我上次买了一套visual studio.net光盘,装上后没问题,可以用,但过了一段时间一启动就说少了组件运行不了,请问是怎么回事?
- C#如何将其他类型转换成Image类型?
- 最近用C#开发了一个3D缩水软件,大家帮忙看看
string[] strArry = Regex.Replace(aa, @"(\w{2})0{2}", "$1,").Split(',');
for (int i = 0; i < strArry.Length-1; i++)
{
Console.Write("{0}",(char)Convert.ToInt16(strArry[i], 16));
}
string[] hexValuesSplit = hexValues.Split(' ');
foreach (String hex in hexValuesSplit)
{
// Convert the number expressed in base-16 to an integer.
int value = Convert.ToInt32(hex, 16);
// Get the character corresponding to the integral value.
string stringValue = Char.ConvertFromUtf32(value);
char charValue = (char)value;
Console.WriteLine("hexadecimal value = {0}, int value = {1}, char value = {2} or {3}",
hex, value, stringValue, charValue);
}
/* Output:
hexadecimal value = 48, int value = 72, char value = H or H
hexadecimal value = 65, int value = 101, char value = e or e
hexadecimal value = 6C, int value = 108, char value = l or l
hexadecimal value = 6C, int value = 108, char value = l or l
hexadecimal value = 6F, int value = 111, char value = o or o
hexadecimal value = 20, int value = 32, char value = or
hexadecimal value = 57, int value = 87, char value = W or W
hexadecimal value = 6F, int value = 111, char value = o or o
hexadecimal value = 72, int value = 114, char value = r or r
hexadecimal value = 6C, int value = 108, char value = l or l
hexadecimal value = 64, int value = 100, char value = d or d
hexadecimal value = 21, int value = 33, char value = ! or !
*/
hex 是两个字符组合的十六进制:
int value = Convert.ToInt32(hex, 16);
string stringValue = Char.ConvertFromUtf32(value);