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; } } } }
查看全文
相关阅读:
nginx的那些事儿
mysql优化初探
mysql使用心得
mysql 利用触发器来实现check约束
mybtatis添加数据返回主键
maven导入本地jar包
mariadb做读写分离
linux网络(一)
kali进行arp嗅骗和攻击的一次记录
Vue项目中:axios请求拦截器添加token验证
原文地址:https://www.cnblogs.com/javawebsoa/p/2458110.html
最新文章
获取 iframe框架嵌入页面的数据
oracl 数据库 连接字符
大写 小写
c# for循环获取dictionary的键和值
xp 日期格式
两个日期相比较
Oracle数据库的使用(一)
LeetCode OJ
LeetCode OJ
LeetCode OJ
热门文章
LeetCode OJ
LeetCode OJ
LeetCode OJ
LeetCode OJ
LeetCode OJ
LeetCode OJ
LeetCode OJ
实现Jenkins+SVN+Maven+Shell命令构建自动化打jar包并部署
实现Jenkins+svn+bat批处理构建svn版本差异增量的自动化打zip包
ps改变图片特定颜色
Copyright © 2011-2022 走看看