public OutputForm(object commandList) { InitializeComponent(); string commandOutput = string.Empty; if (commandList.GetType() == typeof(List <string>)) { commandOutput = CommandRunner.runCommand("cmd.exe", (List <string>)commandList); } else if (commandList.GetType() == typeof(string[])) { commandOutput = CommandRunner.runCommand("cmd.exe", ((string[])commandList).ToList()); } this.richTextBox1.Text = commandOutput; }
public static string runCommand(string exePath, string[] arguments) { return(CommandRunner.runCommand(exePath, new List <string>(arguments))); }