コード例 #1
0
ファイル: MainForm.cs プロジェクト: ashllay/LQGMTool
 private bool StartAll()
 {
     if (!SerivceHelper.ExistService(Config.SqlServer))
     {
         this.Error("SQLServer没有安装");
         return(false);
     }
     if (!SerivceHelper.IsRunningService(Config.SqlServer))
     {
         if (!SerivceHelper.StartService(Config.SqlServer))
         {
             this.Error("无法启动数据库:" + Config.SqlServer);
             return(false);
         }
     }
     if (ProcessPanels != null)
     {
         new Thread(() =>
         {
             foreach (ProcessPanel p in ProcessPanels)
             {
                 if (!p.IsRunning())
                 {
                     p.StartProcess();
                 }
             }
             //	Invoke(new UpdateUI(updateStatu), new object[]{false});
         }).Start();
     }
     if (HttpServer != null)
     {
         HttpServer.Start();
     }
     return(true);
 }
コード例 #2
0
ファイル: MainForm.cs プロジェクト: ashllay/LQGMTool
 private void btnSqlserver_Click(object sender, EventArgs e)
 {
     if (!SerivceHelper.ExistService(Config.SqlServer))
     {
         this.Error("SQLServer没有安装");
         return;
     }
     if (SerivceHelper.IsRunningService(Config.SqlServer))
     {
         SerivceHelper.StopService(Config.SqlServer);
     }
     else
     {
         SerivceHelper.StartService(Config.SqlServer);
     }
     updateStatu();
 }
コード例 #3
0
 private bool StartAll()
 {
     if (!SerivceHelper.ExistService(Config.SqlServer))
     {
         this.Error(R.ErrorSqlServerNotInstall);
         return(false);
     }
     if (!SerivceHelper.IsRunningService(Config.SqlServer))
     {
         if (!SerivceHelper.StartService(Config.SqlServer))
         {
             this.Error(string.Format(R.ErrorSqlServerNotStart, Config.SqlServer));
             return(false);
         }
     }
     using (MSSqlHelper db = new MSSqlHelper(Config.ConnectionString)){
         if (!db.Open())
         {
             this.Error(R.ErrorSqlServerNotConnect);
             return(false);
         }
     }
     if (ProcessPanels != null)
     {
         new Thread(() =>
         {
             foreach (ProcessPanel p in ProcessPanels)
             {
                 if (!p.IsRunning())
                 {
                     p.StartProcess();
                 }
             }
             //	Invoke(new UpdateUI(updateStatu), new object[]{false});
         }).Start();
     }
     if (HttpServer != null)
     {
         HttpServer.Start();
     }
     return(true);
 }