关于网友提出的“ 请问如何判断本机是否可以上网,就像瑞星2004的那样能上显示网页否则显示一个图片”问题疑问,本网通过在网上对“ 请问如何判断本机是否可以上网,就像瑞星2004的那样能上显示网页否则显示一个图片”有关的相关答案进行了整理,供用户进行参考,详细问题解答如下:
问题: 请问如何判断本机是否可以上网,就像瑞星2004的那样能上显示网页否则显示一个图片
描述: 请问如何判断本机是否可以上网,就像瑞星2004的那样能上显示网页否则显示一个图片。前面的如何判断最重要。
解决方案1: Allows an application to check if a connection to the Internet can be established.
BOOL InternetCheckConnection(
LPCTSTR lpszUrl,
DWORD dwFlags,
DWORD dwReserved
);
Parameters
lpszUrl
[in] Pointer to a null-terminated string that specifies the URL to use to check the connection. This value can be NULL.
dwFlags
[in] Options. FLAG_ICC_FORCE_CONNECTION is the only flag that is currently available. If this flag is set, it forces a connection. A sockets connection is attempted in the following order:
If lpszUrl is non-NULL, the host value is extracted from it and used to ping that specific host.
If lpszUrl is NULL and there is an entry in the internal server database for the nearest server, the host value is extracted from the entry and used to ping that server.
dwReserved
[in] Reserved. Must be zero.
Return Values
Returns TRUE if a connection is made successfully, or FALSE otherwise. Use GetLastError to retrieve the error code. ERROR_NOT_CONNECTED is returned by GetLastError if a connection cannot be made or if the sockets database is unconditionally offline.
Requirements
Client: Included in Windows XP, Windows 2000 Professional, Windows NT Workstation 4.0, Windows Me, Windows 98, and Windows 95.
Server: Included in Windows Server 2003, Windows 2000 Server, and Windows NT Server 4.0.
Version: Requires Internet Explorer 3.0 or later.
Header: Declared in Wininet.h.
Library: Use Wininet.lib.
See Also
解决方案2: --显示网页否则显示一个图片-
先发http请示,如果能下载网页就显示,否则就显示图片
以上介绍了“ 请问如何判断本机是否可以上网,就像瑞星2004的那样能上显示网页否则显示一个图片”的问题解答,希望对有需要的网友有所帮助。
本文网址链接:http://www.codes51.com/itwd/3178221.html