Пример #1
0
        public void Form1_Load(object sender, EventArgs e)
        {
            mp = new Settings();

            UnserializeSettingsOLD();

            Console.WriteLine("SYSTEM TEST CONFIRMATION:   " + mp.inputIcons[0]);
            Console.WriteLine("Telnet IP Adress: " + mp.IpAdress);

            CreateButtonArray();

            button1.Anchor = (AnchorStyles.Bottom | AnchorStyles.Right);
            Cancel.Anchor = (AnchorStyles.Bottom | AnchorStyles.Right);
            button3.Anchor = (AnchorStyles.Bottom | AnchorStyles.Right);
            Settings.Anchor = (AnchorStyles.Bottom | AnchorStyles.Right);

            ChannelInputTextBox.Anchor = (AnchorStyles.Bottom | AnchorStyles.Right);
            RadioInput.Anchor = (AnchorStyles.Bottom | AnchorStyles.Right);
            RadioOutput.Anchor = (AnchorStyles.Bottom | AnchorStyles.Right);
            ButtonLabel.Anchor = (AnchorStyles.Bottom | AnchorStyles.Right);
            EnterButton.Anchor = (AnchorStyles.Bottom | AnchorStyles.Right);
            buttonSettingControlsVisibility(false);

            mp.IpAdress = "192.0.2.2";
            mp.port = 23;
            Console.WriteLine("Requesting connection");
            tc = new TelnetConnection(mp.IpAdress, mp.port);
            //tc = new TelnetConnection("127.0.0.1", 23);
            //tc = new TelnetConnection("192.0.2.2", 23);

            Thread thread;
            Console.WriteLine("form starting");
            thread = new Thread(InitializeTelnetInterface);
            thread = new Thread(new ThreadStart(InitializeTelnetInterface));
            thread.Priority = ThreadPriority.Normal;
            thread.Start();
            Console.WriteLine("Telnet Interface initialized");

            //Console.WriteLine("test0");
            //create a new telnet connection to hostname "IP address" on port "23"

            //tc.WriteLine("can you see this");
            //TelnetConnection tc = new TelnetConnection("192.0.2.2", 23);

               // RouterControler controler = new RouterControler(tc);

            //Console.WriteLine("test1");

            //login with user "root",password "rootpassword", using a timeout of 100ms, and show server output
            //string s = "test";

            // server output should end with "$" or ">", otherwise the connection failed

            /*
            // while connected
            Settings test1 = new Settings();
            Settings test2 = new Settings();

            test1.inputs[1] = "1";
            test2.inputs[0] = "0";

            Settings test3 = new Settings();

            Console.WriteLine();
            */

            //CreateButtonArray();
        }
Пример #2
0
        public void Form1_Load(object sender, EventArgs e)
        {
            mp = new Settings();

            UnserializeSettingsOLD();

            Console.WriteLine("SYSTEM TEST CONFIRMATION:   " + mp.inputIcons[0]);
            Console.WriteLine("Telnet IP Adress: " + mp.IpAdress);

            CreateButtonArray();

            button1.Anchor  = (AnchorStyles.Bottom | AnchorStyles.Right);
            Cancel.Anchor   = (AnchorStyles.Bottom | AnchorStyles.Right);
            button3.Anchor  = (AnchorStyles.Bottom | AnchorStyles.Right);
            Settings.Anchor = (AnchorStyles.Bottom | AnchorStyles.Right);


            ChannelInputTextBox.Anchor = (AnchorStyles.Bottom | AnchorStyles.Right);
            RadioInput.Anchor          = (AnchorStyles.Bottom | AnchorStyles.Right);
            RadioOutput.Anchor         = (AnchorStyles.Bottom | AnchorStyles.Right);
            ButtonLabel.Anchor         = (AnchorStyles.Bottom | AnchorStyles.Right);
            EnterButton.Anchor         = (AnchorStyles.Bottom | AnchorStyles.Right);
            buttonSettingControlsVisibility(false);


            mp.IpAdress = "192.0.2.2";
            mp.port     = 23;
            Console.WriteLine("Requesting connection");
            tc = new TelnetConnection(mp.IpAdress, mp.port);
            //tc = new TelnetConnection("127.0.0.1", 23);
            //tc = new TelnetConnection("192.0.2.2", 23);

            Thread thread;

            Console.WriteLine("form starting");
            thread          = new Thread(InitializeTelnetInterface);
            thread          = new Thread(new ThreadStart(InitializeTelnetInterface));
            thread.Priority = ThreadPriority.Normal;
            thread.Start();
            Console.WriteLine("Telnet Interface initialized");



            //Console.WriteLine("test0");
            //create a new telnet connection to hostname "IP address" on port "23"

            //tc.WriteLine("can you see this");
            //TelnetConnection tc = new TelnetConnection("192.0.2.2", 23);

            // RouterControler controler = new RouterControler(tc);

            //Console.WriteLine("test1");


            //login with user "root",password "rootpassword", using a timeout of 100ms, and show server output
            //string s = "test";


            // server output should end with "$" or ">", otherwise the connection failed


            /*
             * // while connected
             * Settings test1 = new Settings();
             * Settings test2 = new Settings();
             *
             * test1.inputs[1] = "1";
             * test2.inputs[0] = "0";
             *
             * Settings test3 = new Settings();
             *
             *
             * Console.WriteLine();
             */



            //CreateButtonArray();
        }