Friday, April 18, 2014
 
    Search Web Link
Search Software
    
API Home » Internet » IsDestinationReachable

IsDestinationReachable

Category: Internet
Hits: 7116 Rating: IsDestinationReachable has been rated 2.64 by  1763 users (2.64) votes 1763
Rate: 1-star  2-stars  3-stars  4-stars  5-stars
E-mail this API to friend E-mail this Code to a friend  save Bookmark this VB API Function
API Explanation
Determines if the specified destination can be reached and provides Quality of Connection (QOC) information for the destination.

Parameter Information
Declare Function IsDestinationReachable Lib "SENSAPI.DLL" Alias "IsDestinationReachableA" (ByVal lpszDestination As String, ByRef lpQOCInfo As QOCINFO) As Long

lpszDestination
Pointer to a string that specifies the destination. The destination can be an IP address, a UNC name, or an URL.

lpQOCInfo
Pointer to the QOCINFO structure that receives the Quality of Connection (QOC) information. You can supply a NULL pointer if the QOC information is not desired.

TRUE
The destination can be reached.
FALSE
Call GetLastError to determine the reason why the destination
Code



Const NETWORK_ALIVE_AOL = &H4
Const NETWORK_ALIVE_LAN = &H1
Const NETWORK_ALIVE_WAN = &H2
Private Type QOCINFO
dwSize As Long
dwFlags As Long
dwInSpeed As Long 'in bytes/second
dwOutSpeed As Long 'in bytes/second
End Type

Private Declare Function IsDestinationReachable Lib "SENSAPI.DLL" Alias "IsDestinationReachableA" (ByVal lpszDestination As String, ByRef lpQOCInfo As QOCINFO) As Long
Private Sub Form_Load()
Dim Ret As QOCINFO
Ret.dwSize = Len(Ret)
If IsDestinationReachable("www.allapi.net", Ret) = 0 Then
MsgBox "The destination cannot be reached!"
Else
MsgBox "The destination can be reached!" + vbCrLf + _
"The speed of data coming in from the destination is " + Format$(Ret.dwInSpeed / 1024, "#.0") + " Kb/s," + vbCrLf + _
"and the speed of data sent to the destination is " + Format$(Ret.dwOutSpeed / 1024, "#.0") + " Kb/s."
End If
End Sub




HOME | MUSIC | DOWNLOADS |  GAMES | TEST-QUIZZES | SITEMAP | ABOUT | HELP
Copyright © 2000 - 2013 Ex-designz. All rights reserved. Website Developed By Dexter Zafra of Myasp-net.com
Link to us | Advertisement | Contact us | Privacy Policy | Terms of use | Accessibility