Windows phone应用开发初体验(环境搭建+helloworld)
来源:互联网 发布:厦门广电网络领导 编辑:程序博客网 时间:2024/04/19 05:39
转载请注明出处 http://blog.csdn.net/jiabinjlu/article/details/7444632
一、环境搭建
1.目前Windows phone 7开发环境只支持win7和vista,系统安装问题这里不进行讲述
2.下载“windows phone developer tools ctp”,自行baidu或google下载
这个开发环境包括了4个组件
Visual Studio 2010 Express for Windows Phone CTP
Windows Phone Emulator CTP
Silverlight for Windows Phone CTP
XNA Game Studio 4.0 CTP
官网下载后的东西是个在线安装包vm_web.exe
个人非常不推荐使用在线安装包安装,由于网络原因,每个人的网络状况不同,在线安装可能会非常慢
推荐大家直接下载WPDT镜像文件,然后进行本地安装
以下是在线安装流程:
安装完成,重启机器
3.注册码
第一次进入Microsoft Visual Studio 2010 Express for Windows Phone的时候不会出现输入注册码。
过一段时间再进入会出现如图情况
点击Obtain a registration key online进入Windows live登录界面,如果有Windows live帐号就直接登录,Windows live id可以是自己的msn和hotmail
登录Windows live后填写一些信息后就会得到registration key,同时registration key会发到你的邮箱
二、编写第一个程序
1.Windows phone的应用是使用C#写的,如果没有C#基础可以先去看看这方面相关的书籍
2.进入Microsoft Visual Studio 2010 Express for Windows Phone,会看到如图界面
3.点击左上方区域的New Project..
在弹出的对话框中选择Windows Phone Application
在下侧填写工程名
4.点击确定后,工程就建立完毕了,可以看到如下界面
左侧为布局编辑器,中间为代码区,右侧是工程视图
5.对这个工程进行简单的修改
右键左侧视图中MY APPLICATION控件,弹出菜单中选择“View XAML”
然后中间代码区会显示该控件的C#代码编辑处
在TextBlock标签中的Text值可以改成自己想要的名字
6.在左侧的Toolbox中拖一个button控件到界面中
调整一下button控件的位置,button上显示的文字可以按照上述的方法改
7.现在我们给button加一个单击响应的事件,右键button控件,弹出的菜单中选择View Code,进入C#代码编辑页面
在红色区域写响应的事件,比如弹出MessageBox,代码如下:
MessageBox.Show("hello world!!");
8.保存,按F5启动模拟器
如果遇到“zune software is not install……”错误的话应该是因为模拟器选择问题
将Windows phone 7 device改为Windows phone 7 emulator再次运行即可
9.运行效果
- Windows phone应用开发初体验(环境搭建+helloworld)
- Windows Phone 7开发环境初体验
- [Windows Phone] Windows Phone开发环境搭建
- windows phone开发环境搭建
- Windows Phone 开发环境搭建
- Windows Phone开发环境搭建
- Windows Phone开发环境搭建
- Windows phone 应用开发[8]-体验PhoneGap
- windows 10 for phone开发环境搭建及HelloWorld的创建
- Windows Phone 开发学习笔记(一) 开发环境搭建
- Windows Phone 7 开发环境的搭建
- 简单搭建Windows Phone 7 开发环境
- Windows phone 7开发环境搭建
- windows phone开发环境的搭建
- 搭建Windows phone 7 开发环境
- Windows Phone 7 开发环境的搭建
- Windows Phone 8 开发环境的搭建
- Windows Phone 8 开发环境搭建
- 黑客基础知识学习
- java 16进制 byte[]和int之间的转换
- Android调用WebService(ksoap2 天气预报)
- java文件读取方法大全摘录
- android之旅时间进度
- Windows phone应用开发初体验(环境搭建+helloworld)
- 19个免费的UI界面设计工具及资源
- Eclipse插件:Eclipse Color Theme
- 破坏HelloWorld
- 5个让人激动的Java项目
- android 监听系统新安装程序的广播
- hdoj 4198 Quick out of the Harbour
- linux_thread_learn
- <iostream>he<iostream.h>的区别