Exemplo n.º 1
0
        private void button2_Click(object sender, EventArgs e)
        {
            this.Invoke((MethodInvoker) delegate
            {
                GetProcessesByName kill = new GetProcessesByName(this.Killing_Python_Procsess);
                this.Invoke(kill);
            });


            this.Close();
        }
Exemplo n.º 2
0
        private void button2_Click(object sender, EventArgs e)
        {
            this.Invoke((MethodInvoker)delegate
            {
                GetProcessesByName kill = new GetProcessesByName(this.Killing_Python_Procsess);
                this.Invoke(kill);

            });

            this.Close();
        }
Exemplo n.º 3
0
        public void Pipe_Reader(NamedPipeServerStream server)
        {
            //int i = 0;

            var br = new BinaryReader(server);
            while (true)
            {
                try
                {
                    //i++;
                    var len = (int)br.ReadUInt32();
                    if (len == 0)
                        MessageBox.Show("Error");
                    var str = new string(br.ReadChars(len));    // Read string
                    if (str == "Logged In!")
                    {

                        //Start_Explorer();
                        if (this.InvokeRequired)
                        {
                            this.Invoke((MethodInvoker)delegate
                            {

                                this.Hide();
                                (new Form1()).ShowDialog();
                            });
                            break;
                        }
                    }

                    else
                    {

                        if (this.InvokeRequired)
                        {
                            this.Invoke((MethodInvoker)delegate
                            {
                                GetProcessesByName kill = new GetProcessesByName(this.Killing_Python_Procsess);
                                this.Invoke(kill);

                            });

                             this.Invoke((MethodInvoker)delegate
                             {
                                 MessageBox.Show(str);
                                 progressBar1.Visible = false;
                                 button1.Visible = true;
                                 button3.Enabled = true;
                             });

                            this.Invoke((MethodInvoker)delegate
                            {
                                MessageBox.Show("Wrong User Name Or Password");
                                KBF_Activation_Delegate KBF = new KBF_Activation_Delegate(this.KBF_Activation);
                                this.Invoke(KBF);

                            });
                            continue;
                        }

                    }
                }

                catch
                {
                    //MessageBox.Show("Error");
                }

            }

            //Pipe_Writer(server);
        }
Exemplo n.º 4
0
        public void Pipe_Reader(NamedPipeServerStream server)
        {
            //int i = 0;

            var br = new BinaryReader(server);

            while (true)
            {
                try
                {
                    //i++;
                    var len = (int)br.ReadUInt32();
                    if (len == 0)
                    {
                        MessageBox.Show("Error");
                    }
                    var str = new string(br.ReadChars(len));    // Read string
                    if (str == "Logged In!")
                    {
                        //Start_Explorer();
                        if (this.InvokeRequired)
                        {
                            this.Invoke((MethodInvoker) delegate
                            {
                                this.Hide();
                                (new Form1()).ShowDialog();
                            });
                            break;
                        }
                    }

                    else
                    {
                        if (this.InvokeRequired)
                        {
                            this.Invoke((MethodInvoker) delegate
                            {
                                GetProcessesByName kill = new GetProcessesByName(this.Killing_Python_Procsess);
                                this.Invoke(kill);
                            });

                            this.Invoke((MethodInvoker) delegate
                            {
                                MessageBox.Show(str);
                                progressBar1.Visible = false;
                                button1.Visible      = true;
                                button3.Enabled      = true;
                            });

                            this.Invoke((MethodInvoker) delegate
                            {
                                MessageBox.Show("Wrong User Name Or Password");
                                KBF_Activation_Delegate KBF = new KBF_Activation_Delegate(this.KBF_Activation);
                                this.Invoke(KBF);
                            });
                            continue;
                        }
                    }
                }

                catch
                {
                    //MessageBox.Show("Error");
                }
            }

            //Pipe_Writer(server);
        }