private void button2_Click(object sender, EventArgs e) { //获取华氏温度 double f = Convert.ToDouble(textBox2.Text); ServiceReference2.Service1Client client = new ServiceReference2.Service1Client(); label5.Text = "摄氏温度为:" + client.F2c(f).ToString(); }
protected void button1_Click(object sender, EventArgs e) { //获取摄氏温度 double c = Convert.ToDouble(textBox1.Text); ServiceReference2.Service1Client client = new ServiceReference2.Service1Client(); label3.Text = "华氏温度为:" + client.C2f(c).ToString(); }
protected void Button1_Click(object sender, EventArgs e) { string inputtext; string[] outputText; ServiceReference2.Service1Client client = new ServiceReference2.Service1Client(); inputtext = TextBox1.Text; outputText = client.Weather(inputtext); Label2.Text = outputText[0]; Label5.Text = outputText[1]; Label7.Text = outputText[2]; Label8.Text = outputText[3]; Label4.Text = outputText[4]; Label12.Text = outputText[5]; Label13.Text = outputText[6]; Label14.Text = outputText[7]; Label15.Text = outputText[8]; Label16.Text = outputText[9];; }