[我的ASP.net学习历程]类型转换

[入库:2005年8月18日] [更新:2007年3月24日]

本文简介:选择自 bgu 的 blog

<%@ page language="c#" autoeventwireup="true" %>
<script language="c#" runat="server">
void page_load(object sender,eventargs e){
 int intstr;
 string str;
 char charstr;
 if (!ispostback){
  label_1.text="please input number string in textbox!";
  }
 else{
  intstr=int32.parse(input_1.value);  //字符串型转换成整型
  str=intstr.tostring();  //整型转换成字符串型
  charstr=str[1];  //把字符串中的第二个字符赋值给字符型变量
  response.write(charstr);
  }
}
</script>
<form id="form_1" runat="server">
<input id="input_1" type="text" runat="server"/>
<input id="button_1" type="submit" value="button" runat="server"/>
</form>
<asp:label id="label_1" runat="server"></asp:label>

本文关键:[我的ASP.net学习历程]类型转换
 

本站最佳浏览方式为 分辨率 1024x768 IE 6.0(或更高版本的 IE浏览器)

go top