zoukankan
html css js c++ java
Windows Phone 7 开发之检查手机网络
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; using System.Net.NetworkInformation; using Microsoft.Phone.Net.NetworkInformation; namespace checknet { public partial class MainPage : PhoneApplicationPage { private bool networkIsAvailable; private NetworkInterfaceType _currentNetworkType; //网络连接的类型 public MainPage() { InitializeComponent(); } private void button1_Click(object sender, RoutedEventArgs e) { networkIsAvailable = Microsoft.Phone.Net.NetworkInformation.NetworkInterface.GetIsNetworkAvailable();//当前网络是否可用 _currentNetworkType = Microsoft.Phone.Net.NetworkInformation.NetworkInterface.NetworkInterfaceType;//获取当前网络的类型 if (networkIsAvailable) { Message.Text = "联网状态"; Message.Background = new SolidColorBrush(Colors.Green); } else { Message.Text = "断网状态"; Message.Background = new SolidColorBrush(Colors.Red); } switch (_currentNetworkType) { case NetworkInterfaceType.MobileBroadbandCdma: netname.Text = "Cdma网络"; break; case NetworkInterfaceType.MobileBroadbandGsm: netname.Text = "Csm网络"; break; case NetworkInterfaceType.Wireless80211: netname.Text = "Wireless网络"; break; case NetworkInterfaceType.Ethernet: netname.Text = "Ethernet网络"; break; case NetworkInterfaceType.None: netname.Text = "网络不可用"; break; default: netname.Text = "其他的网络"; break; } } } }
查看全文
相关阅读:
Atitit.安全性方案规划设计4gm v1 q928
Atitit ati licenseService 设计原理
Atitit.js图表控件总结
Atitit. null错误的设计 使用Optional来处理null
System.Web.Mvc 命名空间
provider: SQL Network Interfaces, error: 26 Error Locating Server/Instance Specified
Visual Studio 2010 实用功能总结
My First J2ME
Java开发利器ideaIU最新版本10.5的keygen
Happy New Year for 2012
原文地址:https://www.cnblogs.com/javawebsoa/p/2458110.html
最新文章
数据库的设计的问题
使用codeblocks编译新版x264
ffmpeg框架代码级分析
x264简介
编码解码中常用术语一
ffmpeg示例一:how to use libavformat and libavcodec to read video from a file.
C语言学习之指针详解
Compile FFmpeg on CentOS
交叉编译cross compiling
使用x264压制视频简介
热门文章
ubuntu下安装最新 版jre 7
Atitit.项目修改补丁打包工具 使用说明
Atitit.java expression fsm 表达式分词fsm引擎
Atitit.你这些项目不都是模板吗?不是 集成和整合的方式大总结
Atitit.atiagent agent分销系统 代理系统 设计文档
Atitit.cto 与技术总监的区别
Atitit.常用的gc算法
Atitit。如何实现dip, di ,ioc ,Service Locator的区别于联系
Atitit.异常处理 嵌套 冗长的解决方案
atitit.attilax的软件 架构 理念.docx
Copyright © 2011-2022 走看看