public InternalCommand(TextBoxShell shellTextBoxCmder, ShellCmder cmdshell) { this.shellTextBoxCmder = shellTextBoxCmder; this.cmdshell = cmdshell; }
/// <summary> /// 回车执行事件 /// </summary> private void shellTextBox_Cmder_CommandEntered(object sender, TextBoxShell.CommandEnteredEventArgs e) { string command = e.Command; Thread thread = new Thread(() => this.ExecuteCmd(command)); thread.SetApartmentState(ApartmentState.STA); thread.IsBackground = true; thread.Start(); }