SocketTools .NET Edition

NntpClient.GetFirstArticle Method (Int32, Int32, NewsArticle)

Return information about a selected range of articles in the current newsgroup.

[Visual Basic]
Overloads Public Function GetFirstArticle( _
   ByVal firstArticle As Integer, _
   ByVal lastArticle As Integer, _
   ByRef article As NewsArticle _
) As Boolean
[C#]
public bool GetFirstArticle(
   int firstArticle,
   int lastArticle,
   ref NewsArticle article
);

Parameters

firstArticle
An integer which specifies the first article to return. A value of -1 specifies that the first available article in the newsgroup should be returned.
lastArticle
An integer which specifies the last article to return. A value of -1 specifies that the last available article in the newsgroup should be returned.
article
A NewsArticle structure which will contain information about the article when the method returns.

Return Value

This method returns a boolean value. If the method succeeds, the return value is true. If the method fails, the return value is false. To get extended error information, check the value of the LastError property.

Remarks

The GetFirstArticle method returns information about the first article in the currently selected newsgroup. This method is used in conjunction with the GetNextArticle method to enumerate all of the articles in the newsgroup. Typically this is used to provide the user with a list of articles to access.

While the articles in the newsgroup are being listed, the client cannot retrieve the contents of a specific article. For example, the GetArticle method cannot be called while inside a loop calling GetNextArticle. The client should store those articles which it wants to retrieve in an array, and then once all of the articles have been listed, it can begin calling GetArticle for each article number to retrieve the article text.

See Also

NntpClient Class | SocketTools Namespace | NntpClient.GetFirstArticle Overload List