3个回答
展开全部
protected void btnOK_Click(object sender, EventArgs e)
{
try
{
int first = Convert.ToInt32(txtFirstName.Text.Trim());
int second = Convert.ToInt32(txtSecondName.Text.Trim());
txtSum.Text = (first + second).ToString();
}
catch
{
Response.Write("您输入的格式错误");
}
}
简单的写了一下,你看看吧
{
try
{
int first = Convert.ToInt32(txtFirstName.Text.Trim());
int second = Convert.ToInt32(txtSecondName.Text.Trim());
txtSum.Text = (first + second).ToString();
}
catch
{
Response.Write("您输入的格式错误");
}
}
简单的写了一下,你看看吧
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询