BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Indy 10 Ping

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Internet Winsock
View previous topic :: View next topic  
Author Message
Ira
Guest





PostPosted: Wed Dec 28, 2005 1:40 pm    Post subject: Indy 10 Ping Reply with 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);

Back to top
Brad Prendergast
Guest





PostPosted: Wed Dec 28, 2005 2:51 pm    Post subject: Re: Indy 10 Ping Reply with quote



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





PostPosted: Wed Dec 28, 2005 5:07 pm    Post subject: Re: Indy 10 Ping Reply with quote




"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
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Internet Winsock All times are GMT
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.