Visual Basic (Declaration) | |
---|---|
Public Overloads Shared Function PingServer( _ ByVal url As String, _ ByVal timeoutMilliseconds As Integer _ ) As Boolean |
Visual Basic (Usage) | ![]() |
---|---|
Dim url As String Dim timeoutMilliseconds As Integer Dim value As Boolean value = HttpFns.PingServer(url, timeoutMilliseconds) |
C# | |
---|---|
public static bool PingServer( string url, int timeoutMilliseconds ) |
C++/CLI | |
---|---|
public: static bool PingServer( String^ url, int timeoutMilliseconds ) |
Parameters
- url
- URL to ping
- timeoutMilliseconds
- The timeout in milliseconds.
Return Value
True if the server respondedA timeoutMilliseconds of 0 indicates that the .NET connection default of 100 seconds should be used. If a negative timeout value is provided, then the server is not pinged.
False
is returned if the server request failed due to a timeout or DNS failure; true
is returned otherwise.
Target Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows Server 2008 family