online/offline status
- From: "kotori" <kotori83@xxxxxxxxx>
- Date: 21 Nov 2005 14:07:46 -0800
I'm trying to develop a program in C# that will change 'label1' in my
form to "online" if a server is present on 127.0.0.1:8080 and "offline"
if it is not.
I was playing around with this:
public static bool UrlIsValid(string smtpHost)
{
bool br = false;
try
{
IPHostEntry ipHost = Dns.Resolve(smtpHost);
br = true;
}
catch (SocketException se)
{
MessageBox.Show (se.Message);
br = false;
}
return br;
}
but that only resolves the hostname.. hence it always returns "offline"
does anyone have a better way of doing this? if there was a 'ping'
command that would probably solve this, but i would need some way to
test the ping return, see where i'm going, this has me quite confused.
Any Help would be appreciated.
~ Kotori
.
- Follow-Ups:
- Re: online/offline status
- From: James Curran
- Re: online/offline status
- Prev by Date: Re: Tabs, Comboxes and ADO.Net Problems
- Next by Date: Re: looking for a product for creating advanced grid
- Previous by thread: looking for a product for creating advanced grid
- Next by thread: Re: online/offline status
- Index(es):
Relevant Pages
|