检查互联网连接 [英] Check Internet Connectivity

查看:151
本文介绍了检查互联网连接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道特定机器上是否可以使用互联网.如何使用vc ++代码找到它.请帮助我..

I would like to know whether the internet is available in the particular machine or not. how to find that using vc++ codes. Please help me..

推荐答案

下面提供的代码段可用于检查VC ++中的Internet连接.

Below provided code snippet can be used for checking internet connection in VC++

bool IsInternetConnection() {
    DWORD result;
    if (!InternetGetConnectedState(result, 0))
        return false;
    
     return true;
        
}


这篇关于检查互联网连接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆