当我的电脑连接了局域网,但是整个局域网没有连接因特网,此函数返回TRUE吗?
也就是说IsNetworkAlive判断的是连接局域网还是因特网啊?
也就是说IsNetworkAlive判断的是连接局域网还是因特网啊?
解决方案 »
- **************求解答*****************
- 用哪个控件
- 啊, 十五年的C语言经历,也会遇到如此问题,请大家看看.怎么啦???
- photoshop的浮动工具条和其他的浮动框是怎么做的?
- *********模拟键盘虚拟按键问题***********
- vb调用vc的dll的问题
- 连接数据库,很简单的问题,在线结贴!
- Re:求助各位大侠了,怎样编写dll形式的com组件?? 关键是怎样实现com对象的实例化??
- 请问我使用WaitForSingleObject()时返回是WAIT_ABANDONED
- 我要些积分!
- 昨天和一个朋友谈 行业
- VS2010下关于Cstring调用读取注册表出错··
IsNetworkAlive FunctionThe IsNetworkAlive function determines whether or not a local system is connected to a network, and identifies the type of network connection, for example, a LAN, WAN, or both.
Syntax
Bool IsNetworkAlive(
__out LPDWORD lpdwFlags
);Parameters
lpdwFlags
The type of network connection that is available. This parameter can be one of the following values:
NETWORK_ALIVE_LAN
The computer has one or more LAN cards that are active.NETWORK_ALIVE_WAN
The computer has one or more active RAS connections.NETWORK_ALIVE_AOL
This flag is not valid. Return Value
This function returns one of the following values:Return code Description
TRUE
A local system is connected to a network. For information about the type of connection, see the lpdwFlags parameter.
FALSE
There is no connection. For extended error information, call GetLastError.
Res
This function can be used by an application to determine whether or not there is network connectivity before proceeding with network operations. A directory service type of application, e-mail client, or Internet browser can adapt to various types of network connectivity. For example, a printing operation can be deferred until a network connection is available.It may not always be practical for an application to call IsNetworkAlive to determine whether or not a local system is disconnected from a LAN, because IsNetworkAlive can be slow, and it may take too much time for the function to detect that a local system is disconnected. However, IsNetworkAlive can always identify a WAN connectivity at the moment.Note This function is only available for TCP/IP connections.如果返回值里有NETWORK_ALIVE_WAN,则说明检测到互联网连接了。
窃以为是通过连接固定的微软的某个服务器进行判断的。