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; } } } }
查看全文
相关阅读:
2017-10-11seowhy记录
2017.8.23创业项目方向
西安项目分析
创业方法
做seowhy官网需要三个人
2017.8.2 高级长尾编辑技巧
Golang 任务队列策略 -- 读《JOB QUEUES IN GO》
Go 到底有没有引用传参(对比 C++ )
使用xorm工具,根据数据库自动生成 go 代码
golang的Channel
原文地址:https://www.cnblogs.com/javawebsoa/p/2458110.html
最新文章
前端性能优化常用总结
动画 收藏
项目中用到的跑马灯、无缝滚动等滚动特效积累
css 样式代码收藏
横向滚动样式
canvas2image
安卓5 白屏
微信二次分享
网站首页html 右中间悬浮图片
ThinkCMF5.1 访问后台地址会跳转到网站首页的解决方案
热门文章
Navicat Premium12.0.24formac已破解中文
自己搭建本地 php 在线执行环境
PHP 7.4 新特性
PHP array_chunk() 函数把数组分割为新的数组块
PHP array_map 一个有趣的函数
PHP array_walk() 函数,对数组中应用自定义函数
电分调图
wordpress数据库结构以及数据表之间的关系
WordPress目录文件结构详细说明
长尾关键词优化
Copyright © 2011-2022 走看看