private void buttonClientConnect_Click(object sender, EventArgs e) { try { ClientForm.ClientTransferType cttf = (ClientForm.ClientTransferType)((this.comboClientType.SelectedIndex + 1) | (byte)(this.checkClientKeys.Checked ? ClientForm.ClientTransferType.KeyEventLogging : 0x00) | (byte)(this.checkClientMouse.Checked ? ClientForm.ClientTransferType.MouseEventLogging : 0x00) | (byte)(this.checkClientScreenCapture.Checked ? 0x00 : ClientForm.ClientTransferType.NoScreenCapture) ); int interval = 1000; switch (this.comboClientSpeed.SelectedIndex) { case 0: interval = 250; break; case 1: interval = 100; break; case 2: interval = 1000; break; } this._neuroLog.WriteFormat("Starting Client", "{0}<{1}:{2}>\n\n-= Settings =-\nConnection Type: {3}\nConnection Speed:{4}\nCapture Interval: {5}ms\nLogging: Screen({6}), Keys({7}), Mouse({8})", this.textClientName.Text, this.textClientAddr.Text, this.comboClientType.SelectedText, this.comboClientSpeed.SelectedText, this.textClientPort.Text, interval, this.checkClientScreenCapture.Checked, this.checkClientKeys.Checked, this.checkClientMouse.Checked); ClientForm cf = new ClientForm(this.textClientAddr.Text, int.Parse(this.textClientPort.Text), cttf, interval, this.textClientName.Text); cf.ShowDialog(); this._neuroLog.Write("Client Closed", "All Good"); } catch (Exception ex) { this._neuroLog.WriteFormat("Client Terminated with Exception", "Message: {0}\n\nStack Trace:\n", ex.Message, ex.StackTrace); MessageBox.Show(ex.Message, "Shoot! An Error Occured", MessageBoxButtons.OK, MessageBoxIcon.Error); } }