示例#1
0
        static void Main()
        {
            mng      = new WSMng();
            TaskList = new List <int>();

            if (sysModel == 1)
            {
                Application.EnableVisualStyles();
                Application.SetCompatibleTextRenderingDefault(false);
                Application.Run(new frmTest());
            }
            else if (sysModel == 0)
            {
                //WINDOWS服务启动
                try
                {
                    ServiceBase[] servicesToRun;
                    servicesToRun = new ServiceBase[] { new EqpService() };
                    ServiceBase.Run(servicesToRun);
                }
                catch (Exception ex)
                {
                    try
                    {
                        CWSException.WriteError(ex.ToString());
                    }
                    catch { }
                }
            }
            else
            {
                MessageBox.Show("参数SystemModel需要配置");
            }
        }
示例#2
0
 static void Main()
 {
     mng = new WSMng();
     if (sysModel == 1)
     {
         Application.EnableVisualStyles();
         Application.SetCompatibleTextRenderingDefault(false);
         Application.Run(new FrmLed());
     }
     else if (sysModel == 0)
     {
         //WINDOWS服务启动
         try
         {
             ServiceBase[] servicesToRun;
             servicesToRun = new ServiceBase[] { new LedEqpService() };
             ServiceBase.Run(servicesToRun);
         }
         catch (Exception ex)
         {
             try
             {
                 CWSException.WriteError("服务开启异常:" + ex.ToString());
             }
             catch { }
         }
     }
     else
     {
         MessageBox.Show("请配置sysModel为O或1");
     }
 }
示例#3
0
        static void Main()
        {
            try
            {
                mng = new WSMng();

                Application.EnableVisualStyles();
                Application.SetCompatibleTextRenderingDefault(false);
                Application.Run(new FrmMain());
            }
            catch (Exception ex)
            {
                MessageBox.Show("无法连接服务端:" + ex.ToString());
            }
        }