예제 #1
0
        private void Form1_Load(object sender, EventArgs e)
        {
            notifyIcon1.Text = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString();
            try
            {
                Config config = Config.Load();
                Config.Save(config);
                this.config = config;
                SetConfigLab(config);
                try
                {
                    Encryptor encryptor = new Encryptor(config.method, config.password);
                    encryptor.Dispose();
                }
                catch (Exception)
                {
                    MessageBox.Show("Open SSL library init failed!");
                    return;
                }

                if (config.multiuser_pylisten == true)
                {
                    this.controlserver = new ControlServer(config);
                    controlserver.Start();
                }
                else
                {
                    server = new Server(config);
                    server.Start();
                }
                thReleaseMem = new Thread(new ThreadStart(ReleaseMemory));
                thReleaseMem.Start();
                thReleaseMem.IsBackground = true;

                this.Hide();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
        }
        private void Form1_Load(object sender, EventArgs e)
        {
            notifyIcon1.Text = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString();
            try
            {
                Config config = Config.Load();
                Config.Save(config);
                this.config = config;
                SetConfigLab(config);
                try
                {
                    Encryptor encryptor = new Encryptor(config.method, config.password);
                    encryptor.Dispose();
                }
                catch(Exception)
                {
                    MessageBox.Show("Open SSL library init failed!");
                    return;
                }

                if (config.multiuser_pylisten == true)
                {
                    this.controlserver = new ControlServer(config);
                    controlserver.Start();
                }
                else
                {
                    server = new Server(config);
                    server.Start();
                }
                thReleaseMem = new Thread(new ThreadStart(ReleaseMemory));
                thReleaseMem.Start();
                thReleaseMem.IsBackground = true;

                this.Hide();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
        }