예제 #1
0
 static void Main(string[] args)
 {
     // Settings settings = new Settings();
     Application.EnableVisualStyles();
     Application.SetCompatibleTextRenderingDefault(false);
     AgentWindow agentWindow = new AgentWindow();
     if (args.Length > 0 && args[0] == "--start")
     {
         Thread.Sleep(2000);
         agentWindow.StartState = true;
     }
     Application.Run(agentWindow);
 }
예제 #2
0
파일: Program.cs 프로젝트: oisy/scada
 static void Main(string[] args)
 {
     bool createNew = false;
     using (Mutex mutex = new Mutex(true, Application.ProductName, out createNew))
     {
         if (createNew)
         {
             Application.EnableVisualStyles();
             Application.SetCompatibleTextRenderingDefault(false);
             AgentWindow agentWindow = new AgentWindow();
             if (args.Length > 0 && args[0] == "--start")
             {
                 Thread.Sleep(2000);
                 agentWindow.StartState = true;
             }
             Application.Run(agentWindow);
         }
         else
         {
             MessageBox.Show("数据上传程序(TCP)已经在运行中...");
         }
     }
 }
예제 #3
0
        static void Main(string[] args)
        {
            bool createNew = false;

            using (Mutex mutex = new Mutex(true, Application.ProductName, out createNew))
            {
                if (createNew)
                {
                    Application.EnableVisualStyles();
                    Application.SetCompatibleTextRenderingDefault(false);
                    AgentWindow agentWindow = new AgentWindow();
                    if (args.Length > 0 && args[0] == "--start")
                    {
                        Thread.Sleep(2000);
                        agentWindow.StartState = true;
                    }
                    Application.Run(agentWindow);
                }
                else
                {
                    MessageBox.Show("数据上传程序(TCP)已经在运行中...");
                }
            }
        }