private void StartTunnel(object param) { try { string tunnelType = param as string; ITunnel tunnel; if (tunnelType == "email") { tunnel = new EmailTunnel(txtSmtpServer.Text, Convert.ToInt32(txtSmtpPort.Text), txtPopServer.Text, Convert.ToInt32(txtPopPort.Text), txtEmailServerEmailAddress.Text, txtEmailClientEmailAddress.Text, txtEmailClientUserName.Text, txtEmailClientPassword.Text); } else { tunnel = new HttpTunnel(new Uri(txtUrl.Text), "POST"); } if (chkEncryptData.Checked) { tunnel = new TunnelDataEncrypter(tunnel, "testing"); } _tunnelLogic.StartTunnel(tunnel, cbNetworkAdapter.SelectedIndex); } catch { } }
private void StartTunnel(object param) { try { string tunnelType = param as string; TunnelLogic tunnelLogic = new TunnelLogic(this); ITunnel tunnel; if (tunnelType == "email") { tunnel = new EmailTunnel(txtSmtpServer.Text, Convert.ToInt32(txtSmtpPort.Text), txtPopServer.Text, Convert.ToInt32(txtPopPort.Text), txtEmailServerEmailAddress.Text, txtEmailClientEmailAddress.Text, txtEmailClientUserName.Text, txtEmailClientPassword.Text); } else { tunnel = new HttpTunnel(new Uri(txtUrl.Text), "POST"); } if (chkEncryptData.Checked) { tunnel = new TunnelDataEncrypter(tunnel, "testing"); } tunnelLogic.StartTunnel(tunnel, txtLocalIPAddr.Text, Convert.ToInt32(txtLocalPort.Text)); } catch (Exception ex) { WriteLine(ex.Message + " " + ex.StackTrace); } }