private void RemoteScreencs_FormClosed(object sender, FormClosedEventArgs e)
 {
     Home.pcform2.Dispose();
     Home.pcform2   = null;
     Home.openform2 = false;
     ListenerPC1.SetResponse("discremote");
 }
Exemple #2
0
        async void doworkAsync()
        {
            ConsoleListener.receiving = true;

            bool firstime = true;

            ListenerPC1.SetResponse("Console*" + command);
            this.BeginInvoke((MethodInvoker) delegate()
            {
                richTextBox1.AppendText(String.Format("{0}{1}", "\n\n-Waiting on Console Response, this may take a while...", Environment.NewLine));
            });

            while (ConsoleListener.receiving == true)
            {
                await Task.Run(() => ConsoleListener.StartListenAsync());

                this.BeginInvoke((MethodInvoker) delegate()
                {
                    string msg = "";
                    msg        = ConsoleListener.consoletext;
                    if (firstime == true)
                    {
                        richTextBox1.AppendText(String.Format("{0}{1}", "\n-Mesage Received!", Environment.NewLine));
                        richTextBox1.AppendText(String.Format("{0}{1}", "\n-Console Output:", Environment.NewLine));
                        richTextBox1.AppendText(String.Format("{0}{1}", "\n" + msg, Environment.NewLine));
                        firstime = false;
                    }
                    else
                    {
                        richTextBox1.AppendText(String.Format("{0}{1}", "\n" + msg, Environment.NewLine));
                    }
                });
            }
        }
Exemple #3
0
 private void TaskManagerPC1_FormClosed(object sender, FormClosedEventArgs e)
 {
     ListenerPC1.SetResponse("Accept");
     Home.pcform1.Dispose();
     Home.pcform1   = null;
     Home.openform1 = false;
     open           = false;
 }
 private void button2_Click(object sender, EventArgs e)
 {
     ListenerPC1.SetResponse("discremote");
     dropcon = true;
     if (serverunning == false)
     {
         this.Close();
     }
 }
Exemple #5
0
        private void button12_Click(object sender, EventArgs e)
        {
            ListenerPC1.SetResponse("remotepc*low");

            open2 = true;

            if (openform2 == false && openform1 == false)
            {
                openform2 = true;
                if (pcform2 == null)
                {
                    pcform2 = new RemoteScreencs();   //Create form if not created
                }

                pcform2.Show(this);  //Show Form assigning this form as the forms owner
            }
        }
Exemple #6
0
        async void doworkAsync()
        {
            while (open == true)
            {
                Thread.Sleep(50);
                ListenerPC1.SetResponse("TaskView");
                await Task.Run(() => TaskViewListenerPC1.StartListenAsync());

                string[] split = TaskViewListenerPC1.consoletext.Split('\n');
                //string[] split2 = TaskViewListenerPC1.networktext.Split('$');

                if (TaskViewListenerPC1.ok == true)
                {
                    string[] finalsplit;
                    int      count           = 0;
                    string   contentfiltered = "";
                    this.BeginInvoke((MethodInvoker) delegate()
                    {
                        foreach (string lines in split)
                        {
                            if (lines != " " && lines != string.Empty && lines != null)
                            {
                                try
                                {
                                    string[] lastsplit = lines.Split(' ');
                                    for (int i = 0; i < lastsplit.Length; i++)
                                    {
                                        if (lastsplit[i] != " " && lastsplit[i] != "" && lastsplit[i] != string.Empty && lastsplit[i] != null)
                                        {
                                            contentfiltered += lastsplit[i] + "&";
                                        }
                                    }

                                    finalsplit = contentfiltered.Split('&');

                                    if (firstimegrid == true)
                                    {
                                        firstimegrid = false;
                                        while (count < 300)
                                        {
                                            dataGridView1.Rows.Add();
                                            count++;
                                        }
                                        count = 0;
                                    }

                                    /*string netinfo = "";
                                     *
                                     * for (int l = 0; l < split2.Length; l++)
                                     * {
                                     *  string[] splitnet = split2[l].Split('&');
                                     *  if(splitnet[0].Contains(finalsplit[1]))
                                     *  {
                                     *      netinfo = splitnet[1].Replace("-",".") + "MB/s";
                                     *      break;
                                     *  }
                                     *
                                     * }*/

                                    dataGridView1.Rows[count].SetValues(count, finalsplit[0], finalsplit[1], finalsplit[2], finalsplit[3], finalsplit[4]);
                                    contentfiltered = "";
                                    count++;
                                }
                                catch (SystemException e)
                                { }
                            }
                        }
                    });
                    TaskViewListenerPC1.ok          = false;
                    TaskViewListenerPC1.consoletext = "";
                    TaskViewListenerPC1.networktext = "";
                    TaskViewListenerPC1.received    = "";
                    Thread.Sleep(1000);
                }
            }
        }