FunWithScheduling fun = new FunWithScheduling();
Console.WriteLine("This Is Your Scheduler");
Console.WriteLine("What Do You Wish To Do");
Console.WriteLine("Enter 1 To Add, 2 To Edit, 3 To Search And 4 To Exit");
int Choice = Convert.ToInt32(Console.ReadLine());
switch (Choice)
{
case 1:
goto fun.Add();
break;
case 2:
goto fun.Edit();
break;
case 3:
goto fun.Search();
break;
case 4:
goto fun.Exit();
break;
Default:
Console.WriteLine("Enter a Valid Number");
return;
}
}
我有 4 个函数可以帮助我执行以下添加编辑搜索退出
我想使用 switch case 去功能。可能吗?它要求一个对象引用,然后是一个标签。