首页  >  文章  >  后端开发  >  ASP.NET简单的格式转换方法

ASP.NET简单的格式转换方法

怪我咯
怪我咯原创
2017-03-30 13:25:171429浏览

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中文网其他相关文章!

声明:
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn