Newsgroups : Borland : borland.public.delphi.internet.winsock : 2006 Apr : Re: idnntp questions/advice - D7 indy 10.1.15
| Subject: | Re: idnntp questions/advice - D7 indy 10.1.15 |
| Posted by: | "Remy Lebeau (TeamB)" (no.spam@no.spam.com) |
| Date: | Thu, 6 Apr 2006 12:30:39 |
"Jacques Noah" <jacques.noah@btinternet.com> wrote in message
news:4434f17d@newsgroups.borland.com...
> Because there are like zillions of messages in this group, i would
> like to download only the first 50 or so messages. How would i
> go about doing this?
Simply limit your loop to the first 50 in the range of numbers. You already
have the smallest and largest numbers, so simply add 50 to the smallest and
make sure it desn't exceed the largest.
> I cannot understand the IdNNTP1.MsgHigh and 'IdNNTP1.MsgLow' properties
I suggest you read RFCs 977 (http://www.ietf.org/rfc/rfc0977.txt) and 2980
(http://www.ietf.org/rfc/rfc2980.txt) for the specific details about how the
NNTP protocol works in general.
> what exactly do they represent in the above code?
The smallest and largest article numbers that are available in the group.
Every message has its own number in the list. In order to retreive a
specific message, you have to know its number in the group.
> Once i've downloaded the 50 messages, i want to read a specific message
> say MsgNo 796, how would i go about doing this?
Simply pass 796 to one of the Get...() methods (GetArticle, GetHeader,
GetBody) that is overloaded with an AMsgNo parameter.
> Below is some code i've tried to use for this purpose, unsuccessfully:
<snip>
> When i run this code, it just freezes.
At which point exactly? Please be more specific.
> I would like to be able to reply to whatever msg i'm reading.
You will have to populate a TIdMessage with the desired values, and then
send it to the server via the Post() method. The newsgroup has to allow
posting or an error will be raised. And make sure that you are fill in the
'References' header of the reply message so that other readers can know
which message(s) are being replied to, so that your reply message can be
displayed to their users in the proper hierarchical manner.
Gambit