检测Internet连接 [英] Detecting Internet Connection

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

问题描述

大家好,我需要能够检测我的VB6程序中是否存在活动可用的

Internet连接。在我的程序中我正在使用互联网

传输控制通过HTTP传输一些文件,但就像现在一样,

没有代码可以检测是否在我尝试发送之前,实际上有一个网络连接可用




有没有简单的方法可以做到这一点?


谢谢,


Adam

Hello all, I need to be able to detect if there is an active available
Internet connection in my VB6 program. In my program I''m using the Internet
Transfer Control to transfer some files by HTTP, but as it stands now,
there''s no code to detect if there is in fact a network connection available
before I try sending.

Is there some easy way to do this?

Thanks,

Adam

推荐答案

私有声明功能InternetGetConnectedState Lib" wininet.dll" ; (ByRef

dwflags As Long,ByVal dwReserved As Long)As long


公共函数IsOnline()As Boolean

Dim LFlags As Long

IsOnline = InternetGetConnectedState(LFlags,0&)

结束功能


-

-

Adam Parkin< sk **** @ dfaslk.com>在消息中写道

news:qm8mc.25304
Private Declare Function InternetGetConnectedState Lib "wininet.dll" (ByRef
dwflags As Long, ByVal dwReserved As Long) As Long

Public Function IsOnline() As Boolean
Dim LFlags As Long
IsOnline = InternetGetConnectedState(LFlags, 0&)
End Function

--
--
Adam Parkin <sk****@dfaslk.com> wrote in message
news:qm8mc.25304


U75.24635@edtnps89 ...
U75.24635@edtnps89...
大家好,我需要成为能够检测我的VB6程序中是否存在活动的可用Internet连接。在我的程序中,我使用
Internet Transfer Control通过HTTP传输一些文件,但是现在看来,没有代码可以检测是否实际存在网络连接
在我尝试发送之前可用。

是否有一些简单的方法可以做到这一点?

谢谢,

Adam
Hello all, I need to be able to detect if there is an active available
Internet connection in my VB6 program. In my program I''m using the Internet Transfer Control to transfer some files by HTTP, but as it stands now,
there''s no code to detect if there is in fact a network connection available before I try sending.

Is there some easy way to do this?

Thanks,

Adam



谢谢,这完美无缺......


Adam


mayayana <毫安************ @ mindZZspring.com>在消息中写道

新闻:yZ ***************** @ newsread3.news.atl.earthl ink.net ...
Thanks, that works perfectly....

Adam

"mayayana" <ma************@mindZZspring.com> wrote in message
news:yZ*****************@newsread3.news.atl.earthl ink.net...
私有声明功能InternetGetConnectedState Lib" wininet.dll"
(ByRef dwflags As Long,ByVal dwReserved As Long)长期

公共函数IsOnline()As Boolean
Dim LFlags As Long
IsOnline = InternetGetConnectedState(LFlags, 0&)
结束功能

-
-
Adam Parkin< sk **** @ dfaslk.com>在消息中写道
新闻:qm8mc.25304
Private Declare Function InternetGetConnectedState Lib "wininet.dll" (ByRef dwflags As Long, ByVal dwReserved As Long) As Long

Public Function IsOnline() As Boolean
Dim LFlags As Long
IsOnline = InternetGetConnectedState(LFlags, 0&)
End Function

--
--
Adam Parkin <sk****@dfaslk.com> wrote in message
news:qm8mc.25304


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

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