 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Ira Guest
|
Posted: Wed Dec 28, 2005 1:40 pm Post subject: Indy 10 Ping |
|
|
I am trying to implement a simple Ping function to determine if
a computer is connected to a local network. I am using Delphi
2005 with Indy 10, using the IdIcmpClient. The reply status
keeps on giving me the same information regardless of whether
the target computer is online or not. Below is my code.
const
Btns: TMsgDlgButtons = [mbOK];
var
RepStatus: TReplyStatus;
begin
IDIcmpClient1.Host := '192.168.10.100';
IDIcmpClient1.Ping;
if (RepStatus.BytesReceived > 0) then
MessageDlg('Ping Time: ' + IntToStr(RepStatus.MsRoundTripTime) + ' ms',
mtInformation, Btns, 0)
else
MessageDlg('Ping Unsuccessful', mtInformation, Btns, 0);
|
|
| Back to top |
|
 |
Brad Prendergast Guest
|
Posted: Wed Dec 28, 2005 2:51 pm Post subject: Re: Indy 10 Ping |
|
|
Ira <ira.weintraub (AT) earthlink (DOT) net> wrote in message
<43b2a3e5$1 (AT) newsgroups (DOT) borland.com>:
| Quote: |
I am trying to implement a simple Ping function to determine if
a computer is connected to a local network. I am using Delphi
2005 with Indy 10, using the IdIcmpClient. The reply status
keeps on giving me the same information regardless of whether
the target computer is online or not. Below is my code.
const
Btns: TMsgDlgButtons = [mbOK];
var
RepStatus: TReplyStatus;
begin
IDIcmpClient1.Host := '192.168.10.100';
IDIcmpClient1.Ping;
if (RepStatus.BytesReceived > 0) then
MessageDlg('Ping Time: ' + IntToStr(RepStatus.MsRoundTripTime) +
' ms', mtInformation, Btns, 0)
else
MessageDlg('Ping Unsuccessful', mtInformation, Btns, 0);
|
IDIcmpClient1.ReplyStatus.BytesReceived
IDIcmpClient1.ReplyStatus.MsRoundTripTime
--
Brad Prendergast
"The only difference between me and a madman is that I'm not mad." --
Salvador Dali (1904 - 1989)
|
|
| Back to top |
|
 |
Ira Guest
|
Posted: Wed Dec 28, 2005 5:07 pm Post subject: Re: Indy 10 Ping |
|
|
"Brad Prendergast" <format('bradp%sbpsoftware.com',['@'])> wrote:
| Quote: | Ira <ira.weintraub (AT) earthlink (DOT) net> wrote in message
43b2a3e5$1 (AT) newsgroups (DOT) borland.com>:
I am trying to implement a simple Ping function to determine if
a computer is connected to a local network. I am using Delphi
2005 with Indy 10, using the IdIcmpClient. The reply status
keeps on giving me the same information regardless of whether
the target computer is online or not. Below is my code.
const
Btns: TMsgDlgButtons = [mbOK];
var
RepStatus: TReplyStatus;
begin
IDIcmpClient1.Host := '192.168.10.100';
IDIcmpClient1.Ping;
if (RepStatus.BytesReceived > 0) then
MessageDlg('Ping Time: ' + IntToStr(RepStatus.MsRoundTripTime) +
' ms', mtInformation, Btns, 0)
else
MessageDlg('Ping Unsuccessful', mtInformation, Btns, 0);
IDIcmpClient1.ReplyStatus.BytesReceived
IDIcmpClient1.ReplyStatus.MsRoundTripTime
--
Brad Prendergast
"The only difference between me and a madman is that I'm not mad." --
Salvador Dali (1904 - 1989)
|
Perfect. Thanks.
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|