首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > asp.net >

类型转换有关问题 求救

2012-01-13 
类型转换问题 求救 在线等intstrNumthis.TextBox4.Textswitch(this.DropDownList1.SelectedItem.Text){c

类型转换问题 求救 在线等
int   strNum   =   this.TextBox4.Text;

switch(this.DropDownList1.SelectedItem.Text)              
{                  
case   "16K ":      
this.TextBox5.Text   =   strNum   /   4;    
break;
case   "8K ":                        
this.TextBox5.Text   =   2*(strNum/   4);    
break;
case   "6K ":
this.TextBox5.Text   =   3*(strNum   /   4);
break;
case   "4K ":
this.TextBox5.Text   =   strNum;
break;
case   "3K ":

this.TextBox5.Text   =   6*(strNum   /   4);
break;
case   "对开 ":
this.TextBox5.Text   =   2*strNum;
break;    
case   "全张 ":
this.TextBox5.Text   =   4*strNum;
break;
}
运行时总是报   无法将int型隐式转化为string    
该怎么转?
救命啊~!~!~

[解决办法]
case "对开 ":
this.TextBox5.Text = Convert.ToString(2*Convert.ToInt32(strNum));

热点排行