谁有获取天气预报的WebService! 我从网上找见了一个获取天气的WebService,速度太慢!简直让人接受不了,请问谁有好一点的Webservice给我一个! 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 http://www.wopos.com/webservice/weather.asmx http://www.wopos.com/webservice/weather.asmx的确能行,但我想问一下有没有中国气象台的,因为这样会更稳定和更权威! http://www.webservicex.net/globalweather.asmx这个,不过是英文的 http://pharaoh.cnblogs.com/archive/2006/03/01/340285.html到这里看看,也许有你要的东西 <?xml version="1.0" encoding="utf-8" ?> <string xmlns="http://www.webserviceX.NET"><?xml version="1.0" encoding="utf-16"?> <CurrentWeather> <Location>Beijing, China (ZBAA) 39-56N 116-17E 55M</Location> <Time>Jul 25, 2006 - 04:00 AM EDT / 2006.07.25 0800 UTC</Time> <Wind> from the S (170 degrees) at 4 MPH (4 KT):0</Wind> <Visibility> 4 mile(s):0</Visibility> <SkyConditions> overcast</SkyConditions> <Temperature> 68 F (20 C)</Temperature> <DewPoint> 64 F (18 C)</DewPoint> <RelativeHumidity> 88%</RelativeHumidity> <Pressure> 29.94 in. Hg (1014 hPa)</Pressure> <Status>Success</Status> </CurrentWeather></string> 还不错收藏 Mark ====CSDN 小助手 V2.5 2005年11月05日发布====CSDN小助手是一款脱离浏览器也可以访问Csdn论坛的软件界面:http://blog.csdn.net/Qqwwee_Com/archive/2005/11/05/523395.aspx下载:http://szlawbook.com/csdnv2 http://www.webservicex.net/globalweather.asmx"major cities by country "!!!XZBS http://search.jaron.cn/ 上面的webservice链接 用webservice是比较慢,我自己写了一个读weather.sina.com.cn的,用AJAX读要比网上的快很多 /**************************************************** Write by :sedemon* complete Date:2006-8-15*************************************************/private string GetCityWeather(int CityNumber){ WebRequest webRequest = WebRequest.Create("http://weather.sina.com.cn/iframe/weather/"+ ParamClass["CityName"] +"_w.html"); webRequest.Credentials = CredentialCache.DefaultCredentials; WebResponse webResponse = webRequest.GetResponse(); Stream stream = webResponse.GetResponseStream(); StreamReader sr = new StreamReader(stream, System.Text.Encoding.Default); string strData = sr.ReadToEnd(); webResponse.Close(); stream.Close(); sr.Close();//7月16日-7月17日 Regex blank = new Regex("\\s"); strData = blank.Replace(strData, ""); Regex table = new Regex("<table.+</table>", RegexOptions.IgnoreCase | RegexOptions.IgnorePatternWhitespace); Regex tag = new Regex("<.+?>"); Regex comma = new Regex("\\,{1,}"); MatchCollection mc = table.Matches(strData, 400); Match imgmc = null; Regex img = new Regex("<imgsrc.+?>"); if(mc.Count == 1) { imgmc = img.Match(mc[0].Value); string sImg = imgmc.Value; int np = sImg.LastIndexOf("."); sImg = sImg.Substring(8, np-4); strData = tag.Replace(mc[0].Value, ","); strData = comma.Replace(strData, ","); strData = strData.Substring(6) + sImg; } return strData;}返回值如下北京,小雨-多云,25℃~14℃,2006年9月25日-26日,风力:小于3级,空气质量:良,,紫外线强度:最弱,,查询北京详细天气情况,http://image2.sina.com.cn/dy/weather/images/figure/smallrain_big.gif http://www.cnblogs.com/jillzhang/archive/2006/08/22/483020.html 楼上的, ParamClass["CityName"] 是怎么来的? 往打开的超级终端添加一行文字 timer.Elapsed 开启的事件不能出config中改变的值。 如何遍历datagridview中选中的行,且取每行中列为ID的值. 我的程序有错吗? dockpanel 问题 哪位能给个C#(winform) 的例子? 请问那为仁兄做过“系统信息的模块“??很急!!解决马上结账! 使用SharpZiplib压缩解压的时候添加密码会出错,何解? 界面显示不了正常数据 请问软件注册,是怎么实现的? WinForm中如何让图片适合pictureBox大小 如何获取DataTable中单元个内容,(在线等)
这个,不过是英文的
到这里看看,也许有你要的东西
<string xmlns="http://www.webserviceX.NET"><?xml version="1.0" encoding="utf-16"?> <CurrentWeather> <Location>Beijing, China (ZBAA) 39-56N 116-17E 55M</Location> <Time>Jul 25, 2006 - 04:00 AM EDT / 2006.07.25 0800 UTC</Time> <Wind> from the S (170 degrees) at 4 MPH (4 KT):0</Wind> <Visibility> 4 mile(s):0</Visibility> <SkyConditions> overcast</SkyConditions> <Temperature> 68 F (20 C)</Temperature> <DewPoint> 64 F (18 C)</DewPoint> <RelativeHumidity> 88%</RelativeHumidity> <Pressure> 29.94 in. Hg (1014 hPa)</Pressure> <Status>Success</Status> </CurrentWeather></string> 还不错
收藏
====CSDN 小助手 V2.5 2005年11月05日发布====
CSDN小助手是一款脱离浏览器也可以访问Csdn论坛的软件
界面:http://blog.csdn.net/Qqwwee_Com/archive/2005/11/05/523395.aspx
下载:http://szlawbook.com/csdnv2
* Write by :sedemon
* complete Date:2006-8-15
*************************************************/private string GetCityWeather(int CityNumber)
{
WebRequest webRequest = WebRequest.Create("http://weather.sina.com.cn/iframe/weather/"+ ParamClass["CityName"] +"_w.html");
webRequest.Credentials = CredentialCache.DefaultCredentials;
WebResponse webResponse = webRequest.GetResponse();
Stream stream = webResponse.GetResponseStream();
StreamReader sr = new StreamReader(stream, System.Text.Encoding.Default);
string strData = sr.ReadToEnd();
webResponse.Close();
stream.Close();
sr.Close();//7月16日-7月17日
Regex blank = new Regex("\\s");
strData = blank.Replace(strData, "");
Regex table = new Regex("<table.+</table>", RegexOptions.IgnoreCase | RegexOptions.IgnorePatternWhitespace);
Regex tag = new Regex("<.+?>");
Regex comma = new Regex("\\,{1,}");
MatchCollection mc = table.Matches(strData, 400);
Match imgmc = null;
Regex img = new Regex("<imgsrc.+?>");
if(mc.Count == 1)
{
imgmc = img.Match(mc[0].Value);
string sImg = imgmc.Value;
int np = sImg.LastIndexOf(".");
sImg = sImg.Substring(8, np-4);
strData = tag.Replace(mc[0].Value, ",");
strData = comma.Replace(strData, ",");
strData = strData.Substring(6) + sImg;
}
return strData;
}
返回值如下北京,小雨-多云,25℃~14℃,2006年9月25日-26日,风力:小于3级,空气质量:良,,紫外线强度:最弱,,查询北京详细天气情况,http://image2.sina.com.cn/dy/weather/images/figure/smallrain_big.gif