Exemple #1
0
        private void button2_Click(object sender, EventArgs e)
        {
            string ip = "";

            for (int i = 0; i < rel.Count; i++)
            {
                if (rel.ElementAt <relacion>(i).Nombre == comboBox4.SelectedItem.ToString())
                {
                    ip = rel.ElementAt <relacion>(i).Ip;
                }
            }
            sonda.Url = "http://" + ip + "/SWSonda/services/Sonda?wsdl";
            string valor = Decrypt(sonda.activarActuador(Encrypt(comboBox3.SelectedItem.ToString(), key)), key);

            sonda.EscribirLog(Encrypt("Actuador de " + comboBox3.SelectedItem.ToString() + " pedido", key), Encrypt(usu, key));
            Sonda.Sonda aux = new Sonda.Sonda();
            aux.Url = "http://" + ip + "/SWSonda/services/Sonda?wsdl";
            if (comboBox3.SelectedItem.ToString().Contains("Temperatura"))
            {
                textBox3.Text = "Temperatura = " + Decrypt(aux.valorTemp(), key) + "º";
            }
            else if (comboBox3.SelectedItem.ToString().Contains("Humedad"))
            {
                textBox3.Text = "Humedad = " + Decrypt(aux.valorHum(), key) + "%";
            }
        }
Exemple #2
0
        private void AñaB_Click(object sender, EventArgs e)
        {
            sonda     = new Sonda.Sonda();
            sonda.Url = "http://" + urlTB.Text + "/SWSonda/services/Sonda?wsdl";
            try
            {
                MessageBox.Show(Decrypt(sonda.getNombre(), key));
                comboBox1.Items.Add(Decrypt(sonda.getNombre(), key));
                comboBox4.Items.Add(Decrypt(sonda.getNombre(), key));
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }

            rel.Add(new relacion(sonTB.Text, urlTB.Text));
        }