1.int str_a=”33”
int i_a=Convert.ToInt16(str_a);转换为短整型(16)
2.charchar_a;
char_a=Convert.ToChar(65);
Response.Write(char_a); 将SCII码表的65转成字符;
结果为A
1. char_a; char_a=”hello world”.ToCharArray();将字符串转为字符型数组
2. 自动转换类型;int age=10; Response.Write(“今年我”+age+”岁”);整型或其他类型,与字符串型加在一起,自动转为字符串型;或者另一种写法:Response.Write(“今年我”+age.tostring()+”岁”);
3. numb_fen=double.parse(textbox_1.text);
lable_1.text=numb_fen;
lable.forcecolor=system.drawing.color.green;标签前景色为绿色;
将文本框的文字转化为double型;
以上就是ASP.NET简单的格式转换方法的详细内容,更多请关注php中文网其它相关文章!
前端(VUE)零基础到就业课程:点击学习
自己动手写 PHP MVC 框架:点击学习
![](http://m.sbmmt.com/img/upload/article/000/000/020/633501a29d313483.png)