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

来源:这里教程网 时间:2026-02-21 13:46:35 作者:

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型;

相关推荐