windows phone 7 学习笔记------常用小工具(一)
2011-04-21 23:22
323 查看
关注WP 7 好久了,也在网上看牛人写的博客很好,从他们中学到了很多的东西。记录新技术的学习过程,并帮助别人一起学习它。学习的宗旨“一起学习共同进步”;
今天写了两个常用的小工具特与大家分享。
说明:这个两个小工具都要用到第三方提供的服务。
小工具一:手机号归属地查询。
运行结果如下:
代码如下:
小工具二:邮政编码查询。
运行结果如下:
代码如下:
非常简单的两个小程序,代码非常的简单。
程序只用着学习使用,不用作商业应用。
原本想上传代码的,可是SkyDrive上传有问题,以后。
今天写了两个常用的小工具特与大家分享。
说明:这个两个小工具都要用到第三方提供的服务。
小工具一:手机号归属地查询。
运行结果如下:
代码如下:
private void btnQuery_Click(object sender, RoutedEventArgs e) { client.getMobileCodeInfoCompleted += new EventHandler<Mobile.getMobileCodeInfoCompletedEventArgs>(client_getMobileCodeInfoCompleted); progressBar.Visibility = System.Windows.Visibility.Visible; if (tbPhone.Text != "") { client.getMobileCodeInfoAsync(tbPhone.Text, ""); } else { MessageBox.Show("电话号不能为空!", "提示", MessageBoxButton.OK); } } void client_getMobileCodeInfoCompleted(object sender, Mobile.getMobileCodeInfoCompletedEventArgs e) { if (e.Error == null) { tbDisplayAddress.Text = e.Result; } }
小工具二:邮政编码查询。
运行结果如下:
代码如下:
void btnQuery_Click(object sender, RoutedEventArgs e) { client.getAddressByZipCodeCompleted += new EventHandler<ChinaZip.getAddressByZipCodeCompletedEventArgs>(client_getAddressByZipCodeCompleted); if (txtPostCode.Text == "") { txtAddress.Text = "没有联接数据!"; } else { client.getAddressByZipCodeAsync(txtPostCode.Text, ""); } } void client_getAddressByZipCodeCompleted(object sender, ChinaZip.getAddressByZipCodeCompletedEventArgs e) { if (e.Error == null) { txtAddress.Text = e.Result.Nodes[0].Value.ToString(); } }
非常简单的两个小程序,代码非常的简单。
程序只用着学习使用,不用作商业应用。
原本想上传代码的,可是SkyDrive上传有问题,以后。
相关文章推荐
- Windows Phone 7 学习笔记------常用工具(二)
- linux学习笔记—— 文本编辑(代码开发工具)——vim之常用命令
- vmware 学习笔记==常见虚拟机创建工具(虚拟机3种联网模式+网络模式切换时+配置静态ip时 的网络(网卡VMnetxxx)的配置###不熟悉!!!很常用)
- BackTrack5 学习笔记2 常用工具
- React学习笔记_常用工具 插件使用
- [转] 关于《Linux常用调试和性能分析工具》的学习笔记
- Java学习笔记49:Java监控常用工具
- 产品经理学习笔记(16)-产品运营常用的工具
- 嵌入式Linux学习笔记(3)——linux系统常用工具
- java学习笔记IO输入与输出——常用工具类(1)
- 【工作笔记】ElasticSearch —— 常用插件/工具汇总
- javascript学习笔记—DOM常用API、属性、方法、函数
- Sublime Text 2学习笔记:常用快捷键
- java WEB学习笔记32:HttpSession 接口常用方法 及 HttpServletRequest接口中的Session方法 Demo
- R语言工具学习笔记(一)修改字体及背景
- 学习笔记--mysql常用数据类型总结
- C++ Primer 学习笔记_97_用来大型程序的工具 -多重继承与虚继承[续2]
- Linux学习笔记三(常用命令)
- [原]Java程序员的JavaScript学习笔记(9—— jQuery工具方法)