From 9f5dfc075434ed6a1c10cdfa68766ae5920a464a Mon Sep 17 00:00:00 2001 From: NYAN CAT Date: Fri, 24 May 2019 23:44:13 +0300 Subject: [PATCH] Update HandleLogs.cs --- .../Handle Packet/HandleLogs.cs | 20 ++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/AsyncRAT-C#/AsyncRAT-Sharp/Handle Packet/HandleLogs.cs b/AsyncRAT-C#/AsyncRAT-Sharp/Handle Packet/HandleLogs.cs index c540635..baf7704 100644 --- a/AsyncRAT-C#/AsyncRAT-Sharp/Handle Packet/HandleLogs.cs +++ b/AsyncRAT-C#/AsyncRAT-Sharp/Handle Packet/HandleLogs.cs @@ -12,19 +12,29 @@ namespace AsyncRAT_Sharp.Handle_Packet { public void Addmsg(string Msg, Color color) { - if (Program.form1.listView2.InvokeRequired) + try { - Program.form1.listView2.BeginInvoke((MethodInvoker)(() => + if (Program.form1.listView2.InvokeRequired) + { + Program.form1.listView2.BeginInvoke((MethodInvoker)(() => + { + ListViewItem LV = new ListViewItem(); + LV.Text = DateTime.Now.ToLongTimeString(); + LV.SubItems.Add(Msg); + LV.ForeColor = color; + Program.form1.listView2.Items.Insert(0, LV); + })); + } + else { ListViewItem LV = new ListViewItem(); LV.Text = DateTime.Now.ToLongTimeString(); LV.SubItems.Add(Msg); LV.ForeColor = color; - Program.form1.listView2.BeginUpdate(); Program.form1.listView2.Items.Insert(0, LV); - Program.form1.listView2.EndUpdate(); - })); + } } + catch { } } } } \ No newline at end of file