Ejemplo n.º 1
0
        public MainForm()
        {
            InitializeComponent();
            startToolStripMenuItem.Enabled = true;
            stopToolStripMenuItem.Enabled = false;
            notifyIcon1.Visible = false;

            var lowNode = Convert.ToInt32(Properties.Settings.Default.startNode);
            var highNode = Convert.ToInt32(Properties.Settings.Default.endNode);
            nodeManager = new NodeManager(lowNode, highNode);

            var portTelnet = Convert.ToInt32(Properties.Settings.Default.port);
            var argumentsTemplateTelnet = Properties.Settings.Default.parameters;
            var portSSH = Convert.ToInt32(Properties.Settings.Default.portSSH); // SSH
            var argumentsTemplateSSH = Properties.Settings.Default.parameters2; // SSH
            serverTelnet = new TelnetServer(nodeManager, portTelnet, argumentsTemplateTelnet, "Telnet");
            serverSSH = new SSHServer(nodeManager, portSSH, argumentsTemplateSSH, "SSH"); // SSH

            serverTelnet.StatusMessageChanged += server_StatusMessage;
            serverTelnet.NodeStatusChanged += server_NodeStatusChanged;
            serverSSH.StatusMessageChanged += server_StatusMessage; // SSH
            serverSSH.NodeStatusChanged += server_NodeStatusChanged; // SSH

            Action<string> logger = delegate (string s)
            {
                server_StatusMessage(this, new StatusMessageEventArgs(s, StatusMessageEventArgs.MessageType.LogInfo));
            };

        }
Ejemplo n.º 2
0
        public MainForm()
        {
            InitializeComponent();
            startToolStripMenuItem.Enabled = true;
            stopToolStripMenuItem.Enabled  = false;
            notifyIcon1.Visible            = false;

            var lowNode  = Convert.ToInt32(Properties.Settings.Default.startNode);
            var highNode = Convert.ToInt32(Properties.Settings.Default.endNode);

            nodeManager = new NodeManager(lowNode, highNode);

            var portTelnet = Convert.ToInt32(Properties.Settings.Default.port);
            var argumentsTemplateTelnet = Properties.Settings.Default.parameters;
            var portSSH = Convert.ToInt32(Properties.Settings.Default.portSSH); // SSH
            var argumentsTemplateSSH = Properties.Settings.Default.parameters2; // SSH

            serverTelnet = new TelnetServer(nodeManager, portTelnet, argumentsTemplateTelnet, "Telnet");
            serverSSH    = new SSHServer(nodeManager, portSSH, argumentsTemplateSSH, "SSH"); // SSH

            serverTelnet.StatusMessageChanged += server_StatusMessage;
            serverTelnet.NodeStatusChanged    += server_NodeStatusChanged;
            serverSSH.StatusMessageChanged    += server_StatusMessage;     // SSH
            serverSSH.NodeStatusChanged       += server_NodeStatusChanged; // SSH

            Action <string> logger = delegate(string s)
            {
                server_StatusMessage(this, new StatusMessageEventArgs(s, StatusMessageEventArgs.MessageType.LogInfo));
            };
        }