读书人

类型转换有关问题 求救

发布时间: 2012-01-13 22:43:29 作者: rapoo

类型转换问题 求救 在线等
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));

读书人网 >asp.net

热点推荐