请问VB判断本地连接的状态(1、本地连接断开;2、本地连接受限;3已连接上)? 5
1个回答
展开全部
给你一个最简单的
module1.bas
Public Declare Function InternetAttemptConnect Lib "wininet " _
(ByVal dwReserved As Long) As Long
Public Const ERROR_SUCCESS = 0
FORM1
Private Sub Command1_Click()
Dim dwResult As Long
' Attempts to make a Internet connection
dwResult = InternetAttemptConnect(0)
If dwResult = ERROR_SUCCESS Then
MsgBox "Attempts to make a internet connection is OK. ", vbInformation + vbOKOnly
Else
MsgBox "Attempts to make a internet connection is failed. ", vbCritical + vbOKOnly
End If
End Sub
module1.bas
Public Declare Function InternetAttemptConnect Lib "wininet " _
(ByVal dwReserved As Long) As Long
Public Const ERROR_SUCCESS = 0
FORM1
Private Sub Command1_Click()
Dim dwResult As Long
' Attempts to make a Internet connection
dwResult = InternetAttemptConnect(0)
If dwResult = ERROR_SUCCESS Then
MsgBox "Attempts to make a internet connection is OK. ", vbInformation + vbOKOnly
Else
MsgBox "Attempts to make a internet connection is failed. ", vbCritical + vbOKOnly
End If
End Sub
更多追问追答
追问
这样的判断只能判断网络断开与否啊,我想知道的是在局域网内判断本地连接的3种状态
追答
2、本地连接受限
这是什么状态?
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询