// We create nntp client object.
NntpClient nntp = new NntpClient();
try
{
// We connect to the nntp server.
nntp.Connect(_tbNntpServer.Text);
// Get a news group on the server
NewsGroup group = nntp.SelectGroup(_tbNewsgroup.Text);
// Display the message count.
string.Format("Message Count: {0}", group.ArticleCount.ToString());
}
catch (NntpException pexp)
{
this.AddLogEntry(string.Format("Nntp Error: {0}", pexp.Message));
}
catch (Exception ex)
{
this.AddLogEntry(string.Format("Failed: {0}", ex.Message));
}
finally
{
if (nntp.IsConnected)
{
nntp.Disconnect(); ;
}
}