Ejemplo n.º 1
0
 public ServerClient(MainWindow mainWindow)
 {
     tcpClient = new TcpClient();
     Instellingen inst = new Instellingen();
     tcpClient.Connect(inst.ip, 15);
     //tcpClient.Connect("192.168.10.1", 15);*/
     var networkStream = tcpClient.GetStream();
     bufferedStream = new StreamWriter(networkStream);
     reader = new StreamReader(networkStream);
     List<string> paramList = new List<string>();
     paramList.Clear();
     paramList.Add("dashboard");
     sendMessage(Command.IDENTYFY, paramList);
     sendMessage(Command.TO_MANUAL, null);
     this.mainWindow = mainWindow;
     Thread t = new Thread(run);
     t.Start();
 }
Ejemplo n.º 2
0
        private void Button_Click_3(object sender, RoutedEventArgs e)
        {
            Instellingen inst = new Instellingen();
            ConnectionInfo connectionInfo = new PasswordConnectionInfo(inst.ip, "pi", "idpgroep5");
             ssh = new SshClient(connectionInfo);

                ssh.Connect();
                var cmd = ssh.CreateCommand("./startSpinOS.sh");   //  very long list
                var asynch = cmd.BeginExecute();
                System.Threading.Thread.Sleep(20000);
                ssh.Disconnect();

            /*SshStream ssh = new SshStream("192.168.10.1", "pi", "idpgroep5");
            //Set the end of response matcher character
            ssh.Prompt = "#";
            //Remove terminal emulation characters
            ssh.RemoveTerminalEmulationCharacters = true;
            //Writing to the SSH channel
            ssh.Write("./startSpinOS.sh");*/
        }
Ejemplo n.º 3
0
 private void Button_Click_4(object sender, RoutedEventArgs e)
 {
     Instellingen inst = new Instellingen();
     string input = Microsoft.VisualBasic.Interaction.InputBox("Geeft ip", "Change ip", inst.ip, -1, -1);
     inst.ip = input;
     inst.Save();
 }