Thanks
bool connectionOK;
try
{
// call a simple service on the Web Server that returns bool true
connectionOK = myWebService.AreYouThere();
}
catch (WebException exc)
{
MessageBox.Show(exc.Message, "Connection Failed");
connectionOK = false;
}
No doubt there are more elegant solutions...
-- Ray
In article <ufMVPjkvBHA.2500@tkmsftngp03>, "Chris Liang" <quan...@yahoo.com>
wrote:
Private Function IsAlive() As Boolean
' Initialize the WebRequest.
Try
Dim myRequest As WebRequest = WebRequest.Create
(GetConfigValue("ESBaseURL"))'//URL for web service asmx
file
Dim x As System.IO.Stream
' Return the response.
Dim myResponse As WebResponse =
myRequest.GetResponse()
' Code to use the WebResponse goes here.
' Close the response to free resources.
x = myResponse.GetResponseStream()
myResponse.Close()
Return (True)
Catch exc As Exception
MessageBox.Show("Eunexus is currently down.
Please check www.eunexusgame.com for the latest updates on
downtime. We apologize for the inconvenience.", "Error",
MessageBoxButtons.OK, MessageBoxIcon.Error)
Me.Close()
Return (False)
End Try
End Function
>.
>
The problem with all of the replies/suggestions posted here is that they
will cause a dial-up connection (or dial-up router like the Intel Anypoint)
to dial in order to fulfill the request. It will also cause problems with
dial-up internet connection sharing (the "server" system will dial whenever
one of the client systems does any of these types of calls).
The ONLY way to do this without causing such devices to dial is to use ICMP
(a.k.a. ping) to an absolute IP address on the 'net. You can't use a name
since that requires a DNS lookup which will cause an dial. Likewise, any TCP
or UDP packet will also cause a dial.
--Doug