示例#1
0
 private void XuLy()
 {
     try
     {
         lay = new Common.Utilities();
         ServerConfig config = lay.ReadConfig();
         Luu.Server = "" + config.Server;
         Luu.IP     = "" + config.Ip;
         Luu.Ports  = Convert.ToInt32(0 + config.Port);
         if (config.Server == "client")
         {
             this.Hide();
             frmSQL fr = new frmSQL();
             fr.Show();
         }
         else
         {
             if (config.Server == "server")
             {
                 server     = new Server_Client.Server(Luu.Ports);
                 Luu.maychu = server;
                 this.Hide();
                 frmSQL fr = new frmSQL();
                 fr.Show();
             }
             else
             {
                 timer1.Stop();
                 count    = 0;
                 RunCount = 0;
                 frmServerConfig frm = new frmServerConfig();
                 frm.ShowDialog();
                 timer1.Start();
             }
         }
     }
     catch (Exception ex)
     { string s = ex.Message.ToString(); Application.Exit(); }
 }
示例#2
0
        private void XuLy()
        {
            try
            {

                lay = new Common.Utilities();
                ServerConfig config = lay.ReadConfig();
                Luu.Server = "" + config.Server;
                Luu.IP = "" + config.Ip;
                Luu.Ports = Convert.ToInt32(0 + config.Port);
                if (config.Server == "client")
                {
                    this.Hide();
                    frmSQL fr = new frmSQL();
                    fr.Show();
                }
                else
                {
                    if (config.Server == "server")
                    {
                        server = new Server_Client.Server(Luu.Ports);
                        Luu.maychu = server;
                        this.Hide();
                        frmSQL fr = new frmSQL();
                        fr.Show();
                    }
                    else
                    {
                        timer1.Stop();
                        count = 0;
                        RunCount = 0;
                        frmServerConfig frm = new frmServerConfig();
                        frm.ShowDialog();
                        timer1.Start();
                    }
                }
            }
            catch (Exception ex)
            { string s = ex.Message.ToString(); Application.Exit(); }
        }