要想開發WP7應用,首先呢,我們需要準備WP7 的開發環境,那麼,WP7 的開發環境所需的條件有
1.Win 7或者Win 8系統
2.Microsoft Vistual Studio 2010 安裝程式
3.Microsoft Vistual Studio 2010 Service Pack 1安裝程式
4.Windows Phone SDK 7.1 安裝程式
1.先安裝Microsoft Visual Studio 2010旗艦版(VS2010中文版下載下傳)官方中文版,下載下傳位址:http://www.xiazaiba.com/html/4614.html
2.再安裝Microsoft Visual Studio 2010 Service Pack1,下載下傳位址:http://down.zdnet.com.cn/detail/43/424986.shtml
3.接着安裝Microsoft Visual Studio SDK7.1 ,下載下傳位址:http://www.microsoft.com/zh-cn/download/details.aspx?id=27570
4.安裝完畢 .建立WP 打開Microsoft Vistual Studio 2010 檔案----》建立-----》項目------》Vistual C#--------》silverlight for windows phone------》windowsphone 應用程式
一、 Microsoft Vistual Studio 2010 安裝程式的安裝步驟如下:
1.首先解壓下載下傳好的Microsoft Vistual Studio 2010 安裝程式 autorun.exe 或者setup.exe進行安裝
2.點選autorun.exe 或者setup.exe後,既可以安裝運作的程式,選擇 ------安裝Microsoft Vistual Studio 2010
3.點選後,等待加載完成,接着點選下一步
4.點選接受許可
5.選擇安裝路徑
6.然後點選安裝,就會出現安裝
7.等待一段時間,就會出現完成界面
8.安裝好後重新開機電腦,啟動Microsoft Vistual Studio 2010 就會出現以下界面
二、 Microsoft Vistual Studio 2010 Service Pack 1安裝步驟如下:
點選Microsoft Vistual Studio 2010 Service Pack 1的安裝程式,出現如下圖檔
2.點選下一步就會出現下一個界面
3.點選接受後會出現安裝界面
4.等待安裝檔案的進度結束後,會出現以下界面
三、Windows Phone SDK 7.1 安裝程式
1.在Windows Phone SDK 7.1中打開setup.exe,并輕按兩下,
2.接着會出現,
3.等一會會出現
4.點選接受
5.點選立即安裝
6.安裝進度完成後會出現以下界面
四、建立WP7 開發程式hello world
1.建立WP 打開Microsoft Vistual Studio 2010 檔案----》建立-----》項目------》Vistual C#--------》silverlight for windows phone------》windowsphone 應用程式
或者點選界面上的建立項目
2.接着呢,Vistual C#--------》silverlight for windows phone------》windowsphone 應用程式
3.選擇windows phone 平台
4.在工具箱中拖進去一個按鈕,然後輕按兩下按鈕就可以進入C# 代碼的編輯界面
代碼如下:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using Microsoft.Phone.Controls;
namespace helloworld
{
public partial class MainPage : PhoneApplicationPage
{
// 構造函數
public MainPage()
{
InitializeComponent();
}
private void button1_Click(object sender, RoutedEventArgs e)
{
MessageBox.Show("Hello Welcome to the Windows Phone 7 World","the autour is wangjie",MessageBoxButton.OK);
}
}
}
點選運作就可以可以看到結果了
ps:有同學可以直接安裝Windows Phone SDK 7.1,這個我沒試過,不過根據電腦的不同,還真可以安好了呢!!