Newsgroups : Borland : borland.public.delphi.internet.winsock : 2006 Apr : idnntp questions/advice - D7 indy 10.1.15

www.cryer.info
Managed Newsgroup Archive

idnntp questions/advice - D7 indy 10.1.15

Subject:idnntp questions/advice - D7 indy 10.1.15
Posted by:"Jacques Noah" (jacques.no..@btinternet.com)
Date:Thu, 6 Apr 2006 11:46:28

I hope someone can help me with this. I'm basically trying to create a
newsgroup reader app. But i cannot find any examples of how to use idnntp
component. What i want to do is this:

I've already worked out(with help from this newsgroup) how to download ALL
the articles in a particular newsgroup, as the code below demonstrates:

var
msgnum:integer;
                  ...
IdNNTP1.Host := 'newsgroups.borland.com';
        IdNNTP1.Connect;
        IdNNTP1.SelectGroup('borland.public.delphi.internet.winsock');
        for MsgNum := IdNNTP1.MsgLow to IdNNTP1.MsgHigh do
        begin
            if IdNNTP1.GetHeader(MsgNum, IdMessage1) then
            application.ProcessMessages;
            li:=list.Items.Add;
            li.Caption:=inttostr(msgnum);
             li.SubItems.add(idmessage1.Subject);
            li.SubItems.add(IdMessage1.From.Name);
            end;
            ........................
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?
I cannot understand the IdNNTP1.MsgHigh and 'IdNNTP1.MsgLow' properties,
what exactly do they represent in the above code?

2. Once i've downloaded the 50 messages, i want to read a specific message
say MsgNo 796, how would i go about doing this? Below is some code i've
tried to use for this purpose, unsuccessfully:

var
msgno:integer;
  .....................
IdNNTP1.Host := 'newsgroups.borland.com';
        if not idnntp1.Connected then idnntp1.Connect;
        IdNNTP1.SelectGroup('borland.public.delphi.internet.winsock');
         IdNNTP1.GetBody(msgno,idmessage1);
         memo1.Lines.Add(idmessage1.Body.Text);
...........

When i run this code, it just freezes.


3. I would like to be able to reply to whatever msg i'm reading. Can someone
help with this?

Thanks

Replies:

www.cryer.info
Managed Newsgroup Archive