SocketTools .NET Edition

NntpClient.StoreArticle Method (Int32, String)

Retrieve an article from the selected newsgroup and store it in a file.

[Visual Basic]
Overloads Public Function StoreArticle( _
   ByVal articleId As Integer, _
   ByVal fileName As String _
) As Boolean
[C#]
public bool StoreArticle(
   int articleId,
   string fileName
);

Parameters

articleId
An integer value which specifies the number of the article to retrieve from the server. This value must be greater than zero.
fileName
A string which specifies the name of the file that will contain the article. If the file does not exist, it will be created. If the file already exists, it will be overwritten.

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 StoreArticle method retrieves an article from the server and stores it in a file on the local system. The contents of the article is stored as a text file, using the specified file name. This method will cause the current thread to block until the message transfer completes, a timeout occurs or the transfer is canceled. During the transfer, the OnProgress event will fire periodically, enabling the application to update any user interface objects such as a progress bar.

The first available article in the current newsgroup can be determined by checking the value of the FirstArticle property. The last available article in the current newsgroup is returned by the LastArticle property.

See Also