基本信息
源码名称:百度地图实例和天气预报实例
源码大小:1.38M
文件格式:.zip
开发语言:C#
更新时间:2015-06-25
友情提示:(无需注册或充值,赞助后即可获取资源下载链接)
嘿,亲!知识可是无价之宝呢,但咱这精心整理的资料也耗费了不少心血呀。小小地破费一下,绝对物超所值哦!如有下载和支付问题,请联系我们QQ(微信同号):813200300
本次赞助数额为: 5 元×
微信扫码支付:5 元
×
请留下您的邮箱,我们将在2小时内将文件发到您的邮箱
源码介绍
百度地图实例代码,和天气预报实例
百度地图实例代码,和天气预报实例
using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Mvc; using System.Security.Cryptography; using System.Net; using System.Text; using System.Xml.Linq; using System.ServiceModel.Dispatcher; using System.Runtime.Serialization; using System.Web.Script.Serialization; using System.Data; namespace MvcApplication1.Controllers { public class tianqiController : Controller { // // GET: /tianqi/ public ActionResult Index() { GetWeather1(); GetWeather2(); GetWeather(); return View(); } public void GetWeather() { Weather.WeatherWebService ww = new Weather.WeatherWebService(); //把webservice当做一个类来操作 string[] weatherInfo = new string[23];//声明string数组存放返回结果 string city = "石家庄";//获得文本框录入的查询城市 weatherInfo = ww.getWeatherbyCityName(city); //以文本框内容为变量实现方法getWeatherbyCityName if (weatherInfo[8] == "") { } else { ViewBag.weatherInfo = weatherInfo; } } public void GetWeather1() { WebClient wc = new WebClient(); string xml = wc.DownloadString("http://m.weather.com.cn/data/101110101.html"); } public void GetWeather2() { //Weather1.WeatherWS ww = new Weather1.WeatherWS(); } } }