国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 學(xué)院 > 開發(fā)設(shè)計 > 正文

SmartPhone手機(jī)上查看QQ天氣預(yù)報

2019-11-18 19:21:48
字體:
供稿:網(wǎng)友

  智能手機(jī)應(yīng)用程序開發(fā)是軟件開發(fā)的一個新的熱點(diǎn),但如何才能跨入這道門楣呢?今天我通過為自己的多普達(dá)565手機(jī)添加一個天氣預(yù)報程序來向大家講解一下。我們都知道QQ有一個免費(fèi)提供給Blog引用的天氣預(yù)報服務(wù)網(wǎng)址http://appnews.qq.com/cgi-bin/news_qq_search?city=上海(上海是我自己所在城市,如果想看自己的城市,在瀏覽器中改成城市名稱即可),現(xiàn)在我使用QQ提供的這個服務(wù),將其包裝部署為一個Web服務(wù),并編寫程序使得我的多普達(dá)565智能手機(jī)能使用這個Web服務(wù)。

  設(shè)備要求:

  PC開發(fā)環(huán)境:Windows xp SP2,Visual Studio 2003.NET,.NET Framework 1.1 SP1

  操作系統(tǒng):Windows Mobile(TM) 2003第二版,版本4.21.1088(Build 14235.2.0.0)

  智能手機(jī):多普達(dá)565

  一、環(huán)境安裝

  首先我們必須安裝.NET Mobile所需要的開發(fā)環(huán)境,必須安裝的軟件(如下軟件都是微軟提供免費(fèi)下載和使用的)

  1、Microsoft ActiveSync 3.7.1

  下載網(wǎng)址:http://www.microsoft.com/windowsmobile/downloads/activesync37.mspx,里面有中文版本,或者,在手機(jī)附帶的微軟光盤里面有安裝程序;最新版本Microsoft ActiveSync 3.8出來了,可以到摘要的頁面中去找鏈接下載,但這個程序我還是用的老版本。

  作用:同步手機(jī)和PC機(jī)數(shù)據(jù)的程序

  2、Microsoft SMARTPHONE 2003 SDK.msi

  下載網(wǎng)址:

  http://download.microsoft.com/download/e/3/1/e310bb99-2f33-4d79-bb8a-41d9cb3c79b4/Microsoft SMARTPHONE 2003 SDK.msi

  3、MobileAppDevToolkit2004.exe

  下載地址:http://download.microsoft.com/download/b/2/5/b25742c0-daa3-4a8c-988d-a947a35e0a68/MobileAppDevToolkit2004.exe

  二、設(shè)計并部署WebService

  1、建立一個名為WeatherService的WebService,并將QQ的天氣服務(wù)轉(zhuǎn)為xml WebService服務(wù),部署在一臺具有固定ip的服務(wù)器上。

  2、新建一個WeatherDataSet.XSD,存儲我們的天氣信息

<?xml version="1.0" encoding="utf-8" ?>
<xs:schema id="WeatherDataSet" targetNamespace="Ezhi.Services.WeatherService" elementFormDefault="qualified"
  attributeFormDefault="qualified" xmlns="Ezhi.Services.WeatherService"    xmlns:mstns="Ezhi.Services.WeatherService"
  xmlns:xs="

<xs:element name="WeatherDataSet" msdata:IsDataSet="true">
<xs:complexType>
 <xs:choice maxOccurs="unbounded">
  <xs:element name="WeatherDS">
   <xs:complexType>
    <xs:sequence>
     <xs:element name="CityName" type="xs:string" minOccurs="0" />
     <xs:element name="Date1" type="xs:string" minOccurs="0" />
     <xs:element name="Weather1" type="xs:string" minOccurs="0" />
     <xs:element name="Temp1" type="xs:string" minOccurs="0" />
     <xs:element name="WindPower1" type="xs:string" minOccurs="0" />
     <xs:element name="Date2" type="xs:string" minOccurs="0" />
     <xs:element name="Weather2" type="xs:string" minOccurs="0" />
     <xs:element name="Temp2" type="xs:string" minOccurs="0" />
     <xs:element name="WindPower2" type="xs:string" minOccurs="0" />
    </xs:sequence>
   </xs:complexType>
  </xs:element>
 </xs:choice>
</xs:complexType>
</xs:element>
</xs:schema>

  3、WeatherService的源代碼如下

#region Using directives

using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Web;
using System.Web.Services;
using System.IO;
using System.Net;
using System.Text;

#endregion

namespace WeatherService
{
 /// <summary>
 /// Service1 的摘要說明。
 /// </summary>

 [WebService(Description="WeatherService 天氣Service",Namespace="WeatherService")]

 public class Weather : System.Web.Services.WebService
 {
  #region Variable
  
PRivate string tommorow;
  #endregion

  #region 構(gòu)造函數(shù)

public Weather()
{
 InitializeComponent();

 if(DateTime.Today.AddDays(1).Month.ToString().Length == 1)
 {
  tommorow= "0"+DateTime.Today.AddDays(1).Month.ToString()+"月" +
      DateTime.Today.AddDays(1).Day.ToString()+"日";
 }
 else
 {
  tommorow= DateTime.Today.AddDays(1).Month.ToString()+"月" +
     DateTime.Today.AddDays(1).Day.ToString()+"日";
 }
}

#endregion

  #region 組件設(shè)計器生成的代碼

//Web 服務(wù)設(shè)計器所必需的

private IContainer components = null;

/// <summary>
/// 設(shè)計器支持所需的方法 - 不要使用代碼編輯器修改
/// 此方法的內(nèi)容。
/// </summary>

private void InitializeComponent()
{}

/// <summary>
/// 清理所有正在使用的資源。
/// </summary>

protected override void Dispose( bool disposing )
{
 if(disposing && components != null)
 {
  components.Dispose();
 }
 base.Dispose(disposing);
}

#endregion

#region [OK] GetWeatherDataSet 天氣預(yù)報

[WebMethod(Description="天氣預(yù)報")]

public DataSet GetWeatherDataSet(string cityName)
{
 string url=@"http://appnews.qq.com/cgi-bin/news_qq_search";
 string weatherData="";

 try
 {
  weatherData = GetPage(url,cityName).Replace(" ","").Trim();
 }
 catch(Exception)
 {
  throw new Exception("對不起,沒有這個城市的天氣信息!");
 }

 //System.Diagnostics.Trace.WriteLine( tommorow );
 //System.Diagnostics.Trace.WriteLine( weatherData );

 WeatherDataSet weatherDs = new WeatherDataSet();
 weatherDs.WeatherDS.AddWeatherDSRow(GetWeatherRow(ref weatherDs,weatherData,cityName) );
 return weatherDs;
}

private WeatherDataSet.WeatherDSRow GetWeatherRow(ref WeatherDataSet weatherDs,string weatherData,string cityName)
{
 WeatherDataSet.WeatherDSRow weatherRow = weatherDs.WeatherDS.NewWeatherDSRow();
 weatherRow.CityName = weatherData.Substring(weatherData.IndexOf("●")+1,cityName.Length);

 weatherRow.Date1 = DateTime.Now.ToLongDateString();

 weatherRow.Weather1 = weatherData.Substring(weatherData.IndexOf("天氣")+"天氣".Length,weatherData.IndexOf("氣溫")-(weatherData.IndexOf("天氣")+"天氣".Length));

 weatherRow.Temp1 = weatherData.Substring(weatherData.IndexOf("氣溫")+"氣溫".Length,weatherData.IndexOf("風(fēng)力")-(weatherData.IndexOf("氣溫")+"氣溫".Length)).Replace("℃-","℃/");

 weatherRow.WindPower1 = weatherData.Substring(weatherData.IndexOf("風(fēng)力")+"風(fēng)力".Length,weatherData.IndexOf(tommorow)-(weatherData.IndexOf("風(fēng)力")+"風(fēng)力".Length));

 weatherRow.Date2 = DateTime.Today.AddDays(1).ToLongDateString();

 weatherRow.Weather2 = weatherData.Substring(weatherData.LastIndexOf("天氣")+"天氣".Length,weatherData.LastIndexOf("氣溫")-(weatherData.LastIndexOf("天氣")+"天氣".Length));

 weatherRow.Temp2 = weatherData.Substring(weatherData.LastIndexOf("氣溫")+"氣溫".Length,weatherData.LastIndexOf("風(fēng)力")-(weatherData.LastIndexOf("氣溫")+"氣溫".Length)).Replace("℃-","℃/");

 weatherRow.WindPower2 = weatherData.Substring(weatherData.LastIndexOf("風(fēng)力")+"風(fēng)力".Length);

 return weatherRow;
}

#endregion

#region GetPageString 獲取QQ的天氣服務(wù)

//private string xx="";

[WebMethod(Description="天氣預(yù)報")]

public string GetPageString(string cityName)
{
 string url=@"http://appnews.qq.com/cgi-bin/news_qq_search";
 return GetPage(url,cityName);
}

private static string GetPage(string url,string cityName)
{
 HttpWebResponse res = null;
 string strResult = "";
 try
 {
  string postData = "city=" + HttpUtility.UrlEncode(cityName,System.Text.Encoding.GetEncoding("GB2312"));
  HttpWebRequest req = (HttpWebRequest)WebRequest.Create(url);
  req.Method = "POST";
  req.KeepAlive = true;
  req.ContentType = "application/x-www-form-urlencoded";
  StringBuilder UrlEncoded = new StringBuilder();
  byte[] SomeBytes = Encoding.ASCII.GetBytes(postData);
  req.ContentLength = SomeBytes.Length;
  Stream newStream = req.GetRequestStream();
  newStream.Write(SomeBytes, 0, SomeBytes.Length);
  newStream.Close();

  //獲得流內(nèi)容

  res = (HttpWebResponse)req.GetResponse();
  System.IO.Stream s=res.GetResponseStream();
  StreamReader reader = new StreamReader(s,System.Text.Encoding.Default);
  strResult=reader.ReadToEnd();
 }
 catch(Exception e)
 {
  strResult = e.ToString();
 }
 finally
 {
  if ( res != null )
  {
   res.Close();
  }
 }

 strResult=strResult.Remove(0,strResult.IndexOf("●"));

 if( cityName != "北京" )
 {
  strResult=strResult.Remove(strResult.IndexOf("北京"),strResult.Length-strResult.IndexOf("北京"));
 }
 else
 {
  strResult=strResult.Remove(strResult.LastIndexOf("北京"),strResult.Length-strResult.LastIndexOf("北京"));
 }

 strResult=strResult.Trim();
 while(strResult.IndexOf(@"<") != -1)
 {
  strResult=strResult.Remove(strResult.IndexOf(@"<"),strResult.IndexOf(@">")-strResult.IndexOf(@"<")+1);
 }

 while(strResult.IndexOf(@" ") != -1)
 {
  strResult=strResult.Replace(" ","");
 }

 string x = Encoding.UTF8.GetString(new Byte[]{10});
 string y = Encoding.UTF8.GetString(new Byte[]{9});

 while(strResult.IndexOf(x) != -1)
 {
  strResult=strResult.Replace(x,"");
 }

 while(strResult.IndexOf(y) != -1)
 {
  strResult=strResult.Replace(y,"");
 }
 return strResult;
}

#endregion
}
}

  記得將在Web.Config文件加入以下節(jié)點(diǎn),使得WebService能被外部訪問

<!-- WebService 獲取的途徑 -->
<webServices>
<protocols>
<add name="HttpSoap"/>
<add name="HttpPost"/>
<add name="HttpGet"/>
<add name="HttpPostLocalhost"/?
<add name="Documentation"/>
</protocols>
</webServices>
  三、新建手機(jī)應(yīng)用程序項目

  1、新建一個智能設(shè)備應(yīng)用程序,在主面板上拖放如圖2所示的幾個控件,其中timer是用來檢查是否數(shù)據(jù)已經(jīng)下載完畢的。


圖1-新建智能設(shè)備應(yīng)用程序


圖2-界面設(shè)計


  2、引用建好的WebService


圖3-引用WebService

  3、WeatherService智能手機(jī)上運(yùn)行的程序源代碼

using System;
using System.Drawing;
using System.Collections;
using System.Windows.Forms;
using System.Data;

namespace WeatherService
{
 /// <summary>
 /// Summary description for MainForm.
 /// </summary>

 public class MainForm : System.Windows.Forms.Form
 {
  private System.Windows.Forms.ComboBox comboBox_City;
  private System.Windows.Forms.MenuItem menuItem1;
  private System.Windows.Forms.Label txt_Weather1;
  private System.Windows.Forms.Label txt_Date1;
  private System.Windows.Forms.Label txt_Temp1;
  private System.Windows.Forms.Label txt_WindPower1;
  private System.Windows.Forms.Label txt_Temp2;
  private System.Windows.Forms.Label txt_WindPower2;
  private System.Windows.Forms.Label txt_Date2;
  private System.Windows.Forms.Label txt_Weather2;
  private System.Windows.Forms.MainMenu mainMenu1;
  private System.Windows.Forms.MenuItem menuItem_Menu;
  private System.Windows.Forms.MenuItem menuItem_Exit;
  private System.Windows.Forms.Label label_City;
  private System.Windows.Forms.Timer timer1;
  private System.Windows.Forms.MenuItem menuItem2;
  private System.Windows.Forms.MenuItem menuItem3;

  public string[] cityList = new string[]
  {
   "北京",
   "上海",
   "天津",
   "石家莊",
   "哈爾濱",
   "沈陽",
   "長春",
   "太原",
   "濟(jì)南",
   "鄭州",
   "天津",
   "呼和浩特",
   "西安",
   "銀川",
   "蘭州",
   "西寧",
   "烏魯木齊",
   "合肥",
   "南昌",
   "南京",
   "杭州",
   "武漢",
   "長沙",
   "廣州",
   "深圳",
   "福州",
   "廈門",
   "南寧",
   "桂林",
   "海口",
   "重慶",
   "成都",
   "貴陽",
   "昆明",
   "拉薩",
   "香港",
   "澳門",
   "臺北",
  };

  public MainForm()
  {
   InitializeComponent();
   foreach( string x in cityList)
   {
    this.comboBox_City.Items.Add(x);
   }

   this.comboBox_City.SelectedIndex = 0;
  }

  /// <summary>
  /// Clean up any resources being used.
  /// </summary>

  protected override void Dispose( bool disposing )
  {
   base.Dispose( disposing );
  }

  #region Windows Form Designer generated code

  /// <summary>
  /// Required method for Designer support - do not modify
  /// the contents of this method with the code editor.
  /// </summary>

  private void InitializeComponent()
  {
   this.mainMenu1 = new System.Windows.Forms.MainMenu();
   this.menuItem1 = new System.Windows.Forms.MenuItem();
   this.menuItem_Menu = new System.Windows.Forms.MenuItem();
   this.menuItem_Exit = new System.Windows.Forms.MenuItem();
   this.menuItem3 = new System.Windows.Forms.MenuItem();
   this.menuItem2 = new System.Windows.Forms.MenuItem();
   this.comboBox_City = new System.Windows.Forms.ComboBox();
   this.label_City = new System.Windows.Forms.Label();
   this.txt_Weather1 = new System.Windows.Forms.Label();
   this.txt_Date1 = new System.Windows.Forms.Label();
   this.txt_Temp1 = new System.Windows.Forms.Label();
   this.txt_WindPower1 = new System.Windows.Forms.Label();
   this.txt_Temp2 = new System.Windows.Forms.Label();
   this.txt_WindPower2 = new System.Windows.Forms.Label();
   this.txt_Date2 = new System.Windows.Forms.Label();
   this.txt_Weather2 = new System.Windows.Forms.Label();
   this.timer1 = new System.Windows.Forms.Timer();

   //
   // mainMenu1
   //

   this.mainMenu1.MenuItems.Add(this.menuItem1);
   this.mainMenu1.MenuItems.Add(this.menuItem_Menu);
   //
   // menuItem1
   //

   this.menuItem1.Text = "確定";
   this.menuItem1.Click += new System.EventHandler(this.menuItem1_Click);

   //
   // menuItem_Menu
   //

   this.menuItem_Menu.MenuItems.Add(this.menuItem_Exit);
   this.menuItem_Menu.MenuItems.Add(this.menuItem3);
   this.menuItem_Menu.MenuItems.Add(this.menuItem2);
   this.menuItem_Menu.Text = "菜單";

   //
   // menuItem_Exit
   //

   this.menuItem_Exit.Text = "退出";
   this.menuItem_Exit.Click += new System.EventHandler(this.menuItem_Exit_Click);

   //
   // menuItem3
   //

   this.menuItem3.Text = "-";

   //
   // menuItem2
   //

   this.menuItem2.Text = "關(guān)于";
   this.menuItem2.Click += new System.EventHandler(this.menuItem2_Click);

   //
   // comboBox_City
   //

   this.comboBox_City.Font = new System.Drawing.Font("Nina", 9F, System.Drawing.FontStyle.Regular);
   this.comboBox_City.Location = new System.Drawing.Point(52, 8);
   this.comboBox_City.Size = new System.Drawing.Size(114, 22);

   //
   // label_City
   //

   this.label_City.Font = new System.Drawing.Font("Nina", 9F, System.Drawing.FontStyle.Bold);
   this.label_City.Location = new System.Drawing.Point(4, 12);
   this.label_City.Size = new System.Drawing.Size(52, 16);
   this.label_City.Text = "城市:";
   this.label_City.TextAlign = System.Drawing.ContentAlignment.TopCenter;

   //
   // txt_Weather1
   //

   this.txt_Weather1.Font = new System.Drawing.Font("Nina", 9F, System.Drawing.FontStyle.Regular);
   this.txt_Weather1.Location = new System.Drawing.Point(12, 50);
   this.txt_Weather1.Size = new System.Drawing.Size(152, 14);
   this.txt_Weather1.Text = "天氣:";

   //
   // txt_Date1
   //

   this.txt_Date1.Font = new System.Drawing.Font("Nina", 9F, System.Drawing.FontStyle.Regular);
   this.txt_Date1.Location = new System.Drawing.Point(12, 34);
   this.txt_Date1.Size = new System.Drawing.Size(152, 14);
   this.txt_Date1.Text = "日期:";

   //
   // txt_Temp1
   //

   this.txt_Temp1.Font = new System.Drawing.Font("Nina", 9F, System.Drawing.FontStyle.Regular);
   this.txt_Temp1.Location = new System.Drawing.Point(12, 68);
   this.txt_Temp1.Size = new System.Drawing.Size(152, 14);
   this.txt_Temp1.Text = "氣溫:";

   //
   // txt_WindPower1
   //

   this.txt_WindPower1.Font = new System.Drawing.Font("Nina", 9F, System.Drawing.FontStyle.Regular);
   this.txt_WindPower1.Location = new System.Drawing.Point(12, 84);
   this.txt_WindPower1.Size = new System.Drawing.Size(152, 14);
   this.txt_WindPower1.Text = "風(fēng)力:";

   //
   // txt_Temp2
   //

   this.txt_Temp2.Font = new System.Drawing.Font("Nina", 9F, System.Drawing.FontStyle.Regular);
   this.txt_Temp2.Location = new System.Drawing.Point(12, 140);
   this.txt_Temp2.Size = new System.Drawing.Size(152, 14);
   this.txt_Temp2.Text = "氣溫:";

   //
   // txt_WindPower2
   //

   this.txt_WindPower2.Font = new System.Drawing.Font("Nina", 9F, System.Drawing.FontStyle.Regular);
   this.txt_WindPower2.Location = new System.Drawing.Point(12, 156);
   this.txt_WindPower2.Size = new System.Drawing.Size(152, 14);
   this.txt_WindPower2.Text = "風(fēng)力:";

   //
   // txt_Date2
   //

   this.txt_Date2.Font = new System.Drawing.Font("Nina", 9F, System.Drawing.FontStyle.Regular);
   this.txt_Date2.Location = new System.Drawing.Point(12, 108);
   this.txt_Date2.Size = new System.Drawing.Size(152, 14);
   this.txt_Date2.Text = "日期:";

   //
   // txt_Weather2
   //

   this.txt_Weather2.Font = new System.Drawing.Font("Nina", 9F, System.Drawing.FontStyle.Regular);
   this.txt_Weather2.Location = new System.Drawing.Point(12, 124);
   this.txt_Weather2.Size = new System.Drawing.Size(152, 14);
   this.txt_Weather2.Text = "天氣:";

   //
   // timer1
   //

   this.timer1.Interval = 200;
   this.timer1.Tick += new System.EventHandler(this.timer1_Tick);

   //
   // MainForm
   //

   this.Controls.Add(this.comboBox_City);
   this.Controls.Add(this.txt_Date1);
   this.Controls.Add(this.txt_Weather1);
   this.Controls.Add(this.label_City);
   this.Controls.Add(this.txt_Temp1);
   this.Controls.Add(this.txt_WindPower1);
   this.Controls.Add(this.txt_Temp2);
   this.Controls.Add(this.txt_WindPower2);
   this.Controls.Add(this.txt_Date2);
   this.Controls.Add(this.txt_Weather2);
   this.Menu = this.mainMenu1;
   this.Text = "天氣預(yù)報";
  }

  #endregion

  /// <summary>
  /// The main entry point for the application.
  /// </summary>

  static void Main()
  {
   Application.Run(new MainForm());
  }

  private void menuItem_Exit_Click(object sender, System.EventArgs e)
  {
   this.Dispose();
  }

  private void menuItem1_Click(object sender, System.EventArgs e)
  {
   SearchWeather(this.comboBox_City.Text);
  }

  private string[] myString = new string[]
  {
    "日期: ",
    "溫度: ",
    "天氣: ",
    "風(fēng)力: ",
  };

  public void SearchWeather(string cityName)
  {
   if( this.txt_Date1.Text != myString[0] )
   {
    ReSelect();
   }

   this.Text = "正在下載...";
   this.timer1.Enabled = true;

   WeatherService.Weather weather = new WeatherService.Weather();
   DataSet myDs = weather.GetWeatherDataSet(cityName);

   this.txt_Date1.Text = myString[0] + myDs.Tables[0].Rows[0]["Date1"].ToString();
   this.txt_Temp1.Text = myString[1] + myDs.Tables[0].Rows[0]["Temp1"].ToString();
   this.txt_Weather1.Text = myString[2] + myDs.Tables[0].Rows[0]["Weather1"].ToString();
   this.txt_WindPower1.Text = myString[3] + myDs.Tables[0].Rows[0]["WindPower1"].ToString();

   this.txt_Date2.Text = myString[0] + myDs.Tables[0].Rows[0]["Date2"].ToString();
   this.txt_Temp2.Text = myString[1] + myDs.Tables[0].Rows[0]["Temp2"].ToString();
   this.txt_Weather2.Text = myString[2] + myDs.Tables[0].Rows[0]["Weather2"].ToString();
   this.txt_WindPower2.Text = myString[3] + myDs.Tables[0].Rows[0]["WindPower2"].ToString();
  }

  private void ReSelect()
  {
   this.txt_Date1.Text = myString[0];
   this.txt_Temp1.Text = myString[1];
   this.txt_Weather1.Text = myString[2];
   this.txt_WindPower1.Text = myString[3];
   this.txt_Date2.Text = myString[0];
   this.txt_Temp2.Text = myString[1];
   this.txt_Weather2.Text = myString[2];
   this.txt_WindPower2.Text = myString[3];
  }

  private void timer1_Tick(object sender, System.EventArgs e)
  {
   if( this.txt_Date1.Text.IndexOf("月") != -1)
   {
    this.timer1.Enabled = false;
    this.Text = "天氣預(yù)報";
   }
  }

  private void menuItem2_Click(object sender, System.EventArgs e)
  {
   this.Text = "作者:賀星河";
   System.Threading.Thread.Sleep(3000);
   this.Text = "天氣預(yù)報";
  }
 }
}

  四、在多普達(dá)565手機(jī)上部署并運(yùn)行

  1、在VS.NET2003的“解決方案WeatherService”上點(diǎn)擊右鍵,選擇”部署解決方案”,出現(xiàn)一下對話框


圖4-部署解決方案

  選擇“部署”,“部署”完成后,手機(jī)上將顯示如下界面


圖5、手機(jī)界面之一-部署

  因?yàn)槲业腜C機(jī)器上安裝了.NET Framework1.1SP1,所以會提示這個界面,選擇“確定”,繼續(xù)執(zhí)行安裝部署:


圖6、手機(jī)界面之二-選擇安裝位置

  選擇安裝位置為”Sotrage Card”,選擇“完成”,這個時候程序就部署完畢了,

  使用Resco Explore 2003,找到安裝部署后程序所在的目錄,在 /Sorage/Program Files/WeatherService/ 目錄下面,執(zhí)行程序WeatherService.exe,將出現(xiàn)如下畫面:


圖7、手機(jī)界面之三-開始執(zhí)行程序 選擇“是”。

  之所以出現(xiàn)這個畫面,是因?yàn)槌绦驔]有經(jīng)過系統(tǒng)的認(rèn)證,也是微軟安全方面的一個體現(xiàn),即時這個程序會正常執(zhí)行,也不會冒然打出電話!

  程序執(zhí)行之后,會出現(xiàn)如下畫面,選擇需要查詢的城市名稱,點(diǎn)“確定”


圖8、手機(jī)界面之四-程序界面

  之后程序標(biāo)題會變?yōu)椤罢谙螺d…”,程序通過GPRS上網(wǎng)讀取部署在Internet上的WebService


圖9、手機(jī)界面之五-運(yùn)行界面

  稍等幾秒鐘之后,便會看到所需要的天氣信息數(shù)據(jù)


圖10、手機(jī)界面之六-運(yùn)行結(jié)果

發(fā)表評論 共有條評論
用戶名: 密碼:
驗(yàn)證碼: 匿名發(fā)表
主站蜘蛛池模板: 灌阳县| 巴彦县| 贺州市| 喀什市| 永济市| 朝阳区| 渭南市| 潢川县| 城口县| 宣恩县| 潞西市| 葵青区| 若尔盖县| 吴旗县| 佛山市| 赣州市| 盐边县| 北宁市| 陇西县| 鄢陵县| 沈丘县| 陆良县| 漳州市| 察哈| 汶上县| 越西县| 克什克腾旗| 奉节县| 荣昌县| 巫山县| 襄城县| 七台河市| 休宁县| 高清| 湘潭县| 天门市| 巧家县| 疏勒县| 四子王旗| 青河县| 乌兰县|