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

tele 2002-01-26 02:52:20
各位大侠帮帮忙,很急!
...全文
71 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
tele 2002-01-26
  • 打赏
  • 举报
回复
试了一下,不好用
总是返回true
有没有源程序,让我看看
black_fox 2002-01-26
  • 打赏
  • 举报
回复
打个记号
wwwsq 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

1,649

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC 非技术类
社区管理员
  • 非技术类社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧