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) + "%"; } }
private void button1_Click(object sender, EventArgs e) { //MessageBox.Show(comboBox1.SelectedItem.ToString()); string ip = ""; for (int i = 0; i < rel.Count; i++) { if (rel.ElementAt <relacion>(i).Nombre == comboBox1.SelectedItem.ToString()) { ip = rel.ElementAt <relacion>(i).Ip; } } sonda.Url = "http://" + ip + "/SWSonda/services/Sonda?wsdl"; MessageBox.Show(comboBox2.SelectedItem.ToString()); if (comboBox2.SelectedItem.ToString() == "Temperatura") { textBox2.Text = "Temperatura = " + Decrypt(sonda.valorTemp(), key) + "º"; sonda.EscribirLog(Encrypt("Temperatura pedida", key), Encrypt(usu, key)); } else { textBox2.Text = "Humedad = " + Decrypt(sonda.valorHum(), key) + "%"; sonda.EscribirLog(Encrypt("Humedad pedida", key), Encrypt(usu, key)); } }