大家帮我来看一段C#天气起预报的代码啊。有点小问题

leroncheung 2010-11-22 10:15:19

MyWeatherWebService.WeatherWebService wws = new WeatherReport.MyWeatherWebService.WeatherWebService();
if (this.cmbCity.Text != "")
{
str = wws.getWeatherbyCityName(this.cmbCity.Text);
}
else
{
str = wws.getWeatherbyCityName(this.cmbProvince.Text);
}
this.lblWeatherIcon1.Image = System.Drawing.Image.FromFile("..\\..\\WeatherImage\\b_" + str[8]);
this.lblWeatherIcon2.Image = System.Drawing.Image.FromFile("..\\..\\WeatherImage\\b_" + str[9]);
this.lblReport.Text = str[6] + " " + str[5] + " " + str[7];
this.weatherReport.Text = str[1] + " " + str[10] + "\n" + str[11];//记录天气具体情况
this.cityIntroduction.Text = str[22];//记录该城市信息



this.lblTomorrow.ForeColor = System.Drawing.Color.Blue;

this.panelTomorrow.Visible = true;
this.lblWeatherIcon3.Image = System.Drawing.Image.FromFile("..\\..\\WeatherImage\\b_" + str[15]);
this.lblWeatherIcon4.Image = System.Drawing.Image.FromFile("..\\..\\WeatherImage\\b_" + str[16]);
this.lblReport2.Text = str[13] + " " + str[12];
this.lblReport3.Text = str[14];


this.lblDayAfterTomorrow.ForeColor = System.Drawing.Color.Blue;

this.panelDayAfterTomorrow.Visible = true;
this.lblWeatherIcon5.Image = System.Drawing.Image.FromFile("..\\..\\WeatherImage\\b_" + str[20]);
this.lblWeatherIcon6.Image = System.Drawing.Image.FromFile("..\\..\\WeatherImage\\b_" + str[21]);
this.lblReport4.Text = str[18] + " " + str[17];
this.lblReport5.Text = str[19];
...全文
146 12 打赏 收藏 转发到动态 举报
写回复
用AI写文章
12 条回复
切换为时间正序
请发表友善的回复…
发表回复
wy811007 2011-06-22
  • 打赏
  • 举报
回复
求这个code研究 啊
jianshao810 2010-11-23
  • 打赏
  • 举报
回复
没有WebService的描述文档?那谁也不知道里面怎么封装的哦。。。
ToMakeLove 2010-11-23
  • 打赏
  • 举报
回复
索引下标应该从0开始
jeven_xiao 2010-11-23
  • 打赏
  • 举报
回复
theDayFlag 指定是当天(1),明天(2)或后天(3)
肯定索引时从0开始的。 你是从1开始 了,所以是明天、后天、还有大后天的啊

该索引的下标不就可以了么
godwilling 2010-11-23
  • 打赏
  • 举报
回复
错了 是www.webxml.com.cn
godwilling 2010-11-23
  • 打赏
  • 举报
回复
你这个WebService应该是 www.webxml.com 提供的。
你看下这个工程里的 webRefrence 里的WebService的地址。
用IE打开看下 具体的说明。
机器人 2010-11-22
  • 打赏
  • 举报
回复
下标是不是应该是从0开始?
leroncheung 2010-11-22
  • 打赏
  • 举报
回复
不知道啊。这个是别人写的。
getWeatherbyCityName
根据城市名称获得天气情况。调用方法如下:输入参数: theCityName 城市中文名称,如深圳,北京; theDayFlag 指定是当天(1),明天(2)或后天(3),可查询未来三天的天气情况;返回数据: String[7] 一个一维数值,共有七个元素,从[1]到[6]分别表示城市,天气,温度,风向,日期,天气图标地址。

我看着上面这样写的。可是我不知道我为什么得到的没有今天的天气情况。第一个就是明天的天气。
机器人 2010-11-22
  • 打赏
  • 举报
回复
没有WebService的描述文档?那谁也不知道里面怎么封装的哦。。。
机器人 2010-11-22
  • 打赏
  • 举报
回复
... 啥问题?
leroncheung 2010-11-22
  • 打赏
  • 举报
回复
谁能告诉我为什么查到的是明天、后天、还有大后天的啊。为什么不是今天的???不知道该怎么改?

110,538

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧