C# switch 语句

          switch ("MySql") //选择语句  // case语句 成对 结束 执行到 第一个break 
            {
                case "SqlServer2000":
                case "SqlServer2005":
                case "SqlServer2008":
                    this.Close(); //关闭当前窗口
                    Form3 frm = new Form3();
                    frm.ShowDialog();
                    break;
                case "MySql":
                    this.Close();
                    Form3 frm1 = new Form3();
                    frm1.ShowDialog();
                    break;
                case "Sqlite":
                    this.Close();
                    Form3 frm2 = new Form3();
                    frm2.ShowDialog();
                    break;
            }

 

        //    switch (length)
        //    {
        //        case 1:

        //            break;
        //        case 3:

        //            break;
        //        case 5:

        //            break;
        //        default:
        //            data = null;
        //            return Json(new { msg = "添加失败", success = flag });
        //    }

 

posted @ 2018-04-11 17:25  enych  阅读(437)  评论(0编辑  收藏  举报