十进制的和十六进制的转换,你应该晓得怎么转吧。using System;public class CharStructureSample {
public static void Main() {
char chs = '汉';
int num=27721;
Console.WriteLine((int)chs);
Console.WriteLine((char)num);
}
}
public static void Main() {
char chs = '汉';
int num=27721;
Console.WriteLine((int)chs);
Console.WriteLine((char)num);
}
}
解决方案 »
- 公司需要一个报表工具,能支持客户自定义修改样式的功能,请大家推荐,免费收费均可。
- C#如何简单实现分页后单选框的checked属性不会改变
- 程序如何开机自启动而不是登录后才启动
- 读取手机卡号码怎么函数!
- 用ASP.NET怎么做"在线答疑"呀?
- 我的DATASET为什么不能反序列化
- .net使用内存怎么这么吓人!!!!
- 传输怎么会跟不上采集,异步委托的高手来看。结构问题还是数据库处理不了?
- 请问用udl连接,能不能用sqlclient?
- WebForm中,使用集成Windows验证,怎样获取所有在线用户的名单?在线等,即时给分!
- 请大家帮忙看一下这个网站,测试有分。
- 两个数据库存储过程的同步(Oracle)(难难:::::)
27721
汉C:\Documents and Settings\Administrator\My Documents\TEMP>
MessageBox.Show(Char.Parse(num1))
会报错
你要的东西
using System;public class CharStructureSample {
public static void Main() {
char chs = '汉';
int num=27721;
System.Windows.Forms.MessageBox.Show(((int)chs).ToString());
System.Windows.Forms.MessageBox.Show(((char)num).ToString());
}
}
System.Windows.Forms.MessageBox.Show(((char)num).ToString());无论在vb.net中还是在c#中,都是可以的。
编译通不过
c:\test\Form1.vb(381): “Char”是类型,因此不是有效表达式。
真是多谢你啊。就送10给你,太少了。可是我都没分了。
等着你的答案.......
{
char chs = '汉';
int num=27721;
this.Page.Response.Write((Convert.ToInt16(chs)));
this.Page.Response.Write(Convert.ToChar(num));
}
我有可用分,但是不能够转移给你(csdn目前关闭了可用分捐赠的功能)
{
char chs = '汉';
int num=27721;
this.Page.Response.Write(Convert.ToString((Convert.ToInt16(chs))));
this.Page.Response.Write(Convert.ToString(Convert.ToChar(num)));
}