public frmBase()
    {
      InitializeComponent();
      frmAutorization frmA = new frmAutorization();
      frmA.ShowDialog();

      connection = frmA.connection;
      db = new DB_CEGSA(connection);
    }
    void NewSession()
    {
      Packet sendData = new Packet();
      sendData.ChatMessage = "LogOut";
      sendData.ChatDataIdentifier = DataIdentifier.Message;
      byte[] data = sendData.GetDataStream();
      for (int i = 0; i < CLientsList.Count; i++)
        serverSocket.BeginSendTo(data, 0, data.Length, SocketFlags.None, CLientsList[i].ep, new AsyncCallback(this.SendData), CLientsList[i].ep);
      if (serverSocket != null)
      {
        //serverSocket.Disconnect(true);
        serverSocket.Dispose();
        //serverSocket.Close();
      }
      Hide();
      frmAutorization frmA = new frmAutorization();
      frmA.ShowDialog();

      connection = frmA.connection;
      db = new DB_CEGSA(connection);
      var_G = new BigInteger(0);
      var_Q = new BigInteger(0);
      var_Y = new BigInteger(0);
      var_E = new BigInteger(0);
      var_S = new BigInteger(0);
      var_R = new BigInteger(0);
      var_NewE = new BigInteger(0);
      var_NewR = new BigInteger(0);
      var_Si = new BigInteger[1];
      var_Hi = new BigInteger[1];
      var_Ri = new BigInteger[1];
      var_Yi = new BigInteger[1];
      int var_Ri_Count = 0;
      int var_Yi_Count = 0;
      int var_Si_Count = 0;
      int var_Hi_Count = 0;
      this.AcceptButton = btnStart;

      kol_clients = 0;
      AllowAutorize = true;
      try
      {
        clientList.Clear();
      }
      catch { }
      try
      {

        listClients.Clear();
      }
      catch { }
      try
      {
        lstClients.Items.Clear();
      }
      catch { }
      try
      {
        CLientsList.Clear();
      }
      catch { }

      lstCurrentClients.Items.Clear();
      progressBar1.Value = 0;
      toolStrip1.Enabled = true;
      tbtnAdd.Enabled = true;
      tbtnDel.Enabled = true;
      tbtnEdit.Enabled = true;
      tbtnChangeAdminPass.Enabled = true;
      btnStart.Enabled = true;
      lstClients.Enabled = true;
      lstCurrentClients.Enabled = true;




      lstCurrentClients.Visible = true;
      btnAddClient.Visible = true;
      btnAddAllClients.Visible = true;
      btnDelAllClients.Visible = true;
      btnDelClient.Visible = true;
      label1.Visible = true;
      lstCurrentClients.Enabled = true;
      btnAddClient.Enabled = true;
      btnAddAllClients.Enabled = true;
      btnDelAllClients.Enabled = true;
      btnDelClient.Enabled = true;
      label1.Enabled = true;
      cmbServerAddress.Enabled = true;


      ReadListClients();

      Show();

    }