如下代码:
private void Button1_Click(object sender, System.EventArgs e)
{
StuInfo student = new StuInfo();
student.stuID = this.TextBox1.Text;
student.stuPassword = this.TextBox2.Text;
DataSet thisSet = new DataSet();
thisSet = student.Volidate();
student.Volidate();
try
{
if(Convert.ToInt32(thisSet.Tables[0].Rows[0][0]) == Convert.ToInt32(student.stuID)
&& Convert.ToInt32(thisSet.Tables[0].Rows[0][1]) == Convert.ToInt32(student.stuPassword))
{
Session["StuID"]=this.TextBox1.Text;
Session["StuPassword"] = student.stuPassword;
Response.Redirect("volidgood.aspx");
// Request.QueryString["uid"];

}
// Response.Redirect("volidbad.aspx");
}
catch(Exception ex)
{
Response.Redirect("volidgood.aspx");
}
finally
{
Response.Redirect("volidbad.aspx");
}
}
在这个位置。我如果不加try。。catch的话。输入的数据能正确跳转。如过输入的数据是错误的加上else的话数据会报错。所以我加上了try但是加上之后我再次输入正确的数据的话。异常也会抛出。怎么回事啊?希望能求解!!