private void WorkWithInput(TextBox InputTextSender) { string InputData = InputTextSender.Text; // set false if you set data for InputText bool IsClearInputText = true; // some command make if (InputData.ToLower().Trim() == "clear") { LogText.Clear(); } else if (InputData.ToLower().Trim() == "restart") { Log("restart"); Application.Restart(); } else if (InputData.ToLower().Trim() == "exit") { Log("exit"); Application.Exit(); } else // normal cmd { Log(InputData); Log(WinHelper.cmd(InputData)); } // Clear Input if (IsClearInputText) { InputTextSender.Clear(); } }
private void ClearLog_Click(object sender, RoutedEventArgs e) { LogText.Dispatcher.Invoke(new Action(() => { LogText.Clear(); })); }
private void LogText_TextChanged(object sender, EventArgs e) { ServerRecv.Text = "Console : " + LogText.Lines.Where(line => !String.IsNullOrEmpty(line)).Count().ToString(); if (LogText.Lines.Length > 50) { Directory.CreateDirectory("CL_cstrike"); StreamWriter file = new StreamWriter("CL_cstrike/" + DateTime.Now.Year + "_" + "ServerConsole.ini"); string CreateServerConsole = LogText.Text + "\n"; file.WriteLine(CreateServerConsole); file.Close(); LogText.Clear(); } this.CheckKeyword("LAN servers are restricted to local clients (class C).", Color.Red, 0); this.CheckKeyword("STEAM certificate length error!", Color.Red, 0); this.CheckKeyword("Invalid authentication type", Color.Red, 0); this.CheckKeyword("Invalid validation type", Color.Red, 0); this.CheckKeyword("This server is using a newer protocol ( %i ) than your client ( %i ). You should check for updates to your client.", Color.Red, 0); this.CheckKeyword("Bad challenge.", Color.Red, 0); this.CheckKeyword("No challenge for your address.", Color.Red, 0); this.CheckKeyword("Expecting STEAM authentication USERID ticket!", Color.Red, 0); this.CheckKeyword("Invalid connection.", Color.Red, 0); this.CheckKeyword("Invalid authentication certificate length.", Color.Red, 0); this.CheckKeyword("Invalid hashed CD key", Color.Red, 0); this.CheckKeyword("Unknown HLTV client type.", Color.Red, 0); this.CheckKeyword("Please connect to HLTV master proxy.", Color.Red, 0); this.CheckKeyword("Hacker", Color.Red, 0); this.CheckKeyword("Insufficient connection info", Color.Red, 0); this.CheckKeyword("No password set. Clean your userinfo.", Color.Red, 0); this.CheckKeyword("You have been banned from this server.", Color.Red, 0); this.CheckKeyword("CL_CreateFakePlayer : ", Color.Red, 0); this.CheckKeyword("This server is secured, please activate", Color.DarkViolet, 0); this.CheckKeyword("\"Bypass ReHLDS\"", Color.DodgerBlue, 0); this.CheckKeyword("Invalid userinfo in connect command", Color.Red, 0); this.CheckKeyword("Bot is successfully connected", Color.Red, 0); this.CheckKeyword("Too many connect packets from your ip address", Color.Red, 0); this.CheckKeyword("Kicked", Color.Red, 0); this.CheckKeyword("SkillartzHD", Color.DarkViolet, 0); this.CheckKeyword("[Auto-Clear console]", Color.DarkBlue, 0); this.CheckKeyword("Spawner", Color.DarkViolet, 0); this.CheckKeyword("-->", Color.Red, 0); this.CheckKeyword("SV_CheckForDuplicateNames v2", Color.LimeGreen, 0); this.CheckKeyword("Invalid protinfo in connect command", Color.Red, 0); this.CheckKeyword("Invalid CDKey", Color.Red, 0); this.CheckKeyword("BADPASSWORD", Color.Red, 0); this.CheckKeyword(steamid.Text, Color.Red, 0); this.CheckKeyword(NameText.Text, Color.DarkViolet, 0); this.CheckKeyword("Server is full.", Color.Red, 0); this.CheckKeyword("Proxy slots are full.", Color.Red, 0); this.CheckKeyword("Sorry, SteamEmu clients are not allowed on this server", Color.Red, 0); this.CheckKeyword("Sorry, no-steam p4 clients are not allowed on this server", Color.Red, 0); this.CheckKeyword("Sorry, HLTV clients are not allowed on this server", Color.Red, 0); this.CheckKeyword("Sorry, oldRevEmu clients are not allowed on this server", Color.Red, 0); this.CheckKeyword("Sorry, AVSMP clients are not allowed on this server", Color.Red, 0); this.CheckKeyword("Sorry, RevEmu clients are not allowed on this server", Color.Red, 0); this.CheckKeyword("Sorry, SetiiEmu clients are not allowed on this server", Color.Red, 0); this.CheckKeyword("STEAM validation rejected", Color.Red, 0); this.CheckKeyword("--------------------------------------------------------------------------", Color.Red, 0); }
private void StartButton_Click(object sender, EventArgs e) { if (UuIdText.Enabled) { return; } LogText.Clear(); stopwatch.Restart(); StartButton.Enabled = false; ClearUuIdTextButton.Enabled = false; StopButton.Enabled = true; TestInfoButton.Enabled = true; try { if (Cache.CacheObjects .SolvedTestSessions .Where(session => session.Value.UuId == UuIdText.Text) .Count() == 1) { var solvedSession = Cache.CacheObjects .SolvedTestSessions .First(session => session.Value.UuId == UuIdText.Text); FinderSystem_OnDocumentIsFound(null, new OnTestDocumentIsFoundArgs(solvedSession.Key, solvedSession.Value)); } else { if (finderSystem is null) { finderSystem = new FinderSystem(client, UuIdText.Text, threadsCount, finderIterationsCount); finderSystem.OnNewDocument += FinderSystem_OnNewDocument; finderSystem.OnDocumentIsFound += FinderSystem_OnDocumentIsFound; finderSystem.OnError += FinderSystem_OnError; finderSystem.Start(); } else { finderSystem.Restart(UuIdText.Text); } } } catch (Exception exception) { OnFatalError(exception); } var testSession = finderSystem.GetTestSession(); if (testSession != null && testSession.Duration.HasValue) { splitContainer2.Panel2.Enabled = true; TestTimer.Start(); } }
//=================== public MainWindow() { //加载XAML布局 InitializeComponent(); _init_help_word(); //装载按键 CtrlButton = StartStop; PortNumber = PortText; PortNumber.MaxLines = 1;//最大行数1行,索引0 LogWindow = LogText; LogText.Clear(); //加载服务器 logger = new LOGGER(LogWindow); server = new BroadcastServer(logger); start = false; }
public MainForm() { InitializeComponent(); ButtonClick(btn_rcl, () => { LogText.Clear(); LogText.AppendText(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + ":" + "开始"); var msg = string.Empty; var e = employee; WRITEDATAEntity WRITEDATA = new WRITEDATAEntity(); WRITEDATA.RQ = this.WriteRq.Value.ToShortDateString(); RCLEntity rcldata = new RCLEntity(); rcldata.RQ = this.WriteRq.Value.ToShortDateString(); // service.WriteDataService.CanHyRcl(rcldata, LogText); service.WriteDataService.CanRcl(WRITEDATA, LogText); }); }
private void button1_Click(object sender, EventArgs e) { LogText.Clear(); OpenFileDialog openFileDialog = new OpenFileDialog { DefaultExt = ".gen", Filter = "GenFile(*.gen)|*.gen", Multiselect = true, Title = "Please Choose Your Gen File", AutoUpgradeEnabled = true, RestoreDirectory = true }; if (openFileDialog.ShowDialog() == DialogResult.OK) { this.FileNames = openFileDialog.FileNames; foreach (var VARIABLE in FileNames) { string str = Path.GetFileName(VARIABLE); LogText.AppendText(str + "\n"); } textBox1.Text = Engine.GetOldPci(FileNames[0]); } }
private void button1_Click_1(object sender, EventArgs e) { LogText.Clear(); }
private void Clear_Click(object sender, EventArgs e) { LogText.Clear(); }
// Log Area private void ButtonClear_Click(object sender, EventArgs e) { LogText.Clear(); LogText.Update(); }