救命啊

rinf 2004-04-05 09:26:12
private void Button1_Click(object sender, System.EventArgs e)
{
if (DropDownList1.SelectedItem.Text=="1")
{
if (a.Text=="")
{
Label5.Text="请填写A选项";
}

else
{
goto a10;
}

}
else if (DropDownList1.SelectedItem.Text=="2")
{
if (a.Text=="")
{
Label5.Text="请填写A选项";
}
else if (b.Text=="")
{
Label5.Text="请填写B选项";
}
else
{
goto a10;
}
}
else
{
}
a10:
string sql;
string connstr = ConfigurationSettings.AppSettings["conString"];
if(tm1.Text=="")
{
Label5.Text="请填写选择题题目!";
}
else
{
string str="";
if (aCheckBox1.Checked==true)
{
str=str+"A";
}
............




请问这个错在哪里啊
为什么检测到错误
他还会一直下去的阿
不会停的
...全文
35 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
hychieftain 2004-04-05
  • 打赏
  • 举报
回复
或break,
楼主写代码不能用goto这样写
hychieftain 2004-04-05
  • 打赏
  • 举报
回复
用return
Firestone2003 2004-04-05
  • 打赏
  • 举报
回复
少用goto
这是菜鸟最基本的

110,534

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧