コード例 #1
0
        protected void findWeather(object sender, EventArgs e)
        {
            string zip   = "";
            string State = "";

            DiyaloReference1.Service1Client prox = new DiyaloReference1.Service1Client();
            if (Request.Cookies["State"] != null && Request.Cookies["City"] != null)
            {
                State = Request.Cookies["State"].Value;
                zip   = Request.Cookies["City"].Value;
            }
            string[] res = prox.getWeather(zip);
            for (int i = 0; i < res.Length; i++)
            {
                if (i == 0)
                {
                    string a = res[i];
                    a = "Date and Time:     " + a;
                    rr.Items.Add(a);
                }
                else if (i == 1)
                {
                    string b = res[i];
                    b = "Temperature(f):    " + b;
                    rr.Items.Add(b);
                }
                else if (i == 2)
                {
                    string c = res[i];
                    c = "Condition:      " + c;
                    rr.Items.Add(c);
                }
            }
        }