diff --git a/agent/windows-setup-agent/SetupWizard.cs b/agent/windows-setup-agent/SetupWizard.cs index 1b068fc3f..3b3b32b03 100644 --- a/agent/windows-setup-agent/SetupWizard.cs +++ b/agent/windows-setup-agent/SetupWizard.cs @@ -194,21 +194,21 @@ namespace Icinga string master_host, master_port; GetMasterHostPort(out master_host, out master_port); - args += " --master_host " + Convert.ToString(master_host).Trim() - + "," + Convert.ToString(master_port).Trim(); + args += " --master_host " + master_host.Trim() + + "," + master_port.Trim(); foreach (ListViewItem lvi in lvwEndpoints.Items) { - args += " --endpoint " + Convert.ToString(lvi.SubItems[0].Text).Trim(); + args += " --endpoint " + lvi.SubItems[0].Text.Trim(); if (lvi.SubItems.Count > 1) { - args += "," + Convert.ToString(lvi.SubItems[1].Text).Trim() - + "," + Convert.ToString(lvi.SubItems[2].Text).Trim(); + args += "," + lvi.SubItems[1].Text.Trim() + + "," + lvi.SubItems[2].Text.Trim(); } } }); if (rdoListener.Checked) - args += " --listen ::," + Convert.ToString(txtListenerPort.Text).Trim(); + args += " --listen ::," + txtListenerPort.Text.Trim(); if (chkAcceptConfig.Checked) args += " --accept-config"; @@ -216,14 +216,14 @@ namespace Icinga if (chkAcceptCommands.Checked) args += " --accept-commands"; - string ticket = Convert.ToString(txtTicket.Text).Trim(); + string ticket = txtTicket.Text.Trim(); if (ticket.Length > 0) args += " --ticket \"" + ticket + "\""; args += " --trustedcert \"" + _TrustedFile + "\""; - args += " --cn \"" + Convert.ToString(txtInstanceName.Text).Trim() + "\""; - args += " --zone \"" + Convert.ToString(txtInstanceName.Text) + "\""; + args += " --cn \"" + txtInstanceName.Text.Trim() + "\""; + args += " --zone \"" + txtInstanceName.Text.Trim() + "\""; if (!RunProcess(Program.Icinga2InstallDir + "\\sbin\\icinga2.exe", "node setup" + args, @@ -234,7 +234,7 @@ namespace Icinga SetConfigureStatus(50, "Setting ACLs for the Icinga 2 directory..."); - string serviceUser = Convert.ToString(txtUser.Text).Trim(); + string serviceUser = txtUser.Text.Trim(); DirectoryInfo di = new DirectoryInfo(Program.Icinga2InstallDir); DirectorySecurity ds = di.GetAccessControl();