Skip to sidebar Skip to content
Ipercube Technical
Jack of all trades, master of none
Date: Time: - Stardate:
Welcome, Log in by clicking  Here!
SS64
MDN
Stack
Code
GitHub
Wiki
Convert
V Studio
  • Home
  • VB Functions
    • Access Functions
    • Assembly Info
    • Color/Image Functions
    • Data Table Functions
    • Email Functions
    • Active Directory Functions
    • LDAP Functions
    • Excel Functions
    • Logging Functions
    • Source Code Retrieval
    • String Functions
    • Sql Functions
    • Object Utilities Functions
    • System and Utilities
    • Utility Forms
  • VB Classes
    • Environment Variables Helper
  • ABAP
    • ABAP Reports
    • ABAP HTTP Functions
Ipercube Technical
  • Home
  • VB Functions
    • Access Functions
    • Assembly Info
    • Color/Image Functions
    • Data Table Functions
    • Email Functions
    • Active Directory Functions
    • LDAP Functions
    • Excel Functions
    • Logging Functions
    • Source Code Retrieval
    • String Functions
    • Sql Functions
    • Object Utilities Functions
    • System and Utilities
    • Utility Forms
  • VB Classes
    • Environment Variables Helper
  • ABAP
    • ABAP Reports
    • ABAP HTTP Functions

Is Host OnLine

Determines if a given host (hostname or IP address) is reachable within the specified timeout period.

Uses the Net.NetworkInformation.Ping class to send an ICMP echo request (“ping”) to the specified host. If an exception occurs (e.g., host not found or network error), the function returns False.

VB
    Public Function IsHostOnLine(Host As String, 
                                 Optional Timeout As Integer = 1000) As Boolean

        Try
            Dim ping As New Net.NetworkInformation.Ping()
            Dim reply As Net.NetworkInformation.PingReply = ping.Send(Host, Timeout)
            Return reply.Status = Net.NetworkInformation.IPStatus.Success
        Catch
            Return False
        End Try

    End Function
Posted by ipercube


© 2026 Ipercube Design