检查网络是否可以连接互联网
2010-09-11 09:58
267 查看
using System;
using System.Collections.Generic;
using System.Text;
using System.Runtime;
using System.Runtime.InteropServices; namespace SmsSoft
{
public class CheckInternetConnection
{
/// <summary>
/// 用于检查网络是否可以连接互联网,true表示连接成功,false表示连接失败
/// </summary>
/// <returns></returns>
[DllImport("wininet.dll")]
private extern static bool InternetGetConnectedState(int Description, int ReservedValue);
public static bool CheckConnection()
{
int Description = 0;
return InternetGetConnectedState(Description, 0);
} }
} 原文地址:http://blog.csdn.net/vince6799/archive/2010/09/10/5876051.aspx
using System.Collections.Generic;
using System.Text;
using System.Runtime;
using System.Runtime.InteropServices; namespace SmsSoft
{
public class CheckInternetConnection
{
/// <summary>
/// 用于检查网络是否可以连接互联网,true表示连接成功,false表示连接失败
/// </summary>
/// <returns></returns>
[DllImport("wininet.dll")]
private extern static bool InternetGetConnectedState(int Description, int ReservedValue);
public static bool CheckConnection()
{
int Description = 0;
return InternetGetConnectedState(Description, 0);
} }
} 原文地址:http://blog.csdn.net/vince6799/archive/2010/09/10/5876051.aspx
相关文章推荐
- 检查网络是否可以连接互联网
- Android检查设备是否可以访问互联网,判断Internet连接,测试网络请求,解析域名
- C#检查网络是否可以连接互联网
- 检查网络是否可以连接互联网
- android ;检查网络是否可以连接
- C#检查网络是否连接的方法
- Netstate检查网络是否连接
- Error:System.Data.SqlClient.SqlException: 在与 SQL Server 建立连接时出现与网络相关的或特定于实例的错误,请检查远程连接是否开启。解决方法
- 检查网络是否连接正常
- 检查3G网络是否连接
- java中可以通过调用ping命令来判断网络是否连接正常
- android 入门学习笔记 检查网络连接是否正常 判断是否为横屏
- 安卓判断网络连接 检查SD卡是否存在源码
- 检查网络连接是否可用
- 检查网络是否连接
- Android检查Internet是否可以正常连接
- 检查Android网络连接是否可用
- Js navigator.onLine 获取设备是否可以上网、连接网络
- 实时检测网络状态及是否可以连接Internet
- (转)检查网络是否连接正常