Office中国论坛/Access中国论坛
标题:
一个获取你连接internet的连接方式
[打印本页]
作者:
tmtony
时间:
2010-7-15 09:39
标题:
一个获取你连接internet的连接方式
可获取你连接internet的连接方式
如modem LAN 代理等
Option Compare Database
Private Declare Function InternetGetConnectedStateEx Lib "wininet.dll" _
Alias "InternetGetConnectedStateExA" _
(ByRef lpdwFlags As Long, _
ByVal lpszConnectionName As String, _
ByVal dwNameLen As Long, _
ByVal dwReserved As Long _
) As Long
Public Enum EIGCInternetConnectionState
INTERNET_CONNECTION_MODEM = &H1&
INTERNET_CONNECTION_LAN = &H2&
INTERNET_CONNECTION_PROXY = &H4&
INTERNET_RAS_INSTALLED = &H10&
INTERNET_CONNECTION_OFFLINE = &H20&
INTERNET_CONNECTION_CONFIGURED = &H40&
End Enum
Public Property Get InternetConnected( _
Optional ByRef eConnectionInfo As EIGCInternetConnectionState _
) As Boolean
Dim dwflags As Long
Dim sNameBuf As String
Dim lR As Long
Dim iPos As Long
sNameBuf = String$(513, 0)
lR = InternetGetConnectedStateEx(dwflags, sNameBuf, 512, 0&)
eConnectionInfo = dwflags
iPos = InStr(sNameBuf, vbNullChar)
If iPos > 0 Then
sConnectionName = Left$(sNameBuf, iPos - 1)
ElseIf Not sNameBuf = String$(513, 0) Then
sConnectionName = sNameBuf
End If
InternetConnected = (lR = 1)
End Property
复制代码
作者:
Grant
时间:
2010-7-15 10:44
留个脚印
作者:
xuwenning
时间:
2010-7-15 16:18
学习
学习
作者:
82077802
时间:
2010-7-15 18:12
学习
学习
作者:
t小宝
时间:
2010-7-17 16:06
收藏学习
作者:
zhangxiaozhong
时间:
2010-8-5 21:21
xuexi
欢迎光临 Office中国论坛/Access中国论坛 (http://www.office-cn.net/)
Powered by Discuz! X3.3