在vc中如何知道网线是否插好,就像win2000一样

tele 2002-01-26 02:52:20
各位大侠帮帮忙,很急!
...全文
52 点赞 收藏 4
写回复
4 条回复
切换为时间正序
当前发帖距今超过3年,不再开放新的回复
发表回复
tele 2002-01-26
试了一下,不好用
总是返回true
有没有源程序,让我看看
回复
black_fox 2002-01-26
打个记号
回复
王绍全 2002-01-26
IsNetworkAlive
Determines whether the local system is connected to a network and the type of network connection, for example, LAN, WAN, or both.

Bool IsNetworkAlive(
LPDWORD lpdwFlags // Specifies the type of network connection
);
Parameters
lpdwFlags
Provides information on the type of network connection available when the return value is TRUE. The flags can be:
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 only valid in Windows 95 and Windows 98. Indicates the computer is connected to the America Online network.
Return Values
TRUE
The local system is connected to a network.
FALSE
Call GetLastError to determine the reason for no connectivity.
Remarks
This function can be used by applications to determine whether there is network connectivity before proceeding with network operations. Applications such as directory service applications, e-mail clients, or Internet browsers can adapt to various types of network connectivity. For example, a printing operation can be deferred until the network connection is available.

Note This function is only available for TCP/IP connections.

Requirements
Windows NT/2000: Requires Windows 2000 (or Windows NT 4.0 with Internet Explorer 5 or later).
Windows 95/98: Requires Windows 95 or later (with Internet Explorer 5 or later).
Header: Declared in Sensapi.h.
Library: Use Sensapi.lib.
Unicode: Implemented as Unicode and ANSI versions on Windows NT/2000.

See Also
IsDestinationReachable, About System Event Notification Service

回复
bxiang 2002-01-26
试试 IsNetworkAlive
回复
相关推荐
发帖
非技术类
创建于2007-09-28

1621

社区成员

VC/MFC 非技术类
申请成为版主
帖子事件
创建了帖子
2002-01-26 02:52
社区公告
暂无公告