Members

Technology Zones

Articles

Hosted By

MaximumASP

Info

Rated
Read 34,391 times

Contents

Related Categories

How to NNTP in C# - Introduction

randy

Introduction

This is the third in a series of articles on Internet programming with Microsoft's new C# programming language. In the first two articles, I wrote two simple TCP/ IP classes for SMTP and POP3 clients. In this article, I'm going to write a simple NNTP class.

NNTP is an older fading protocol in the Internet protocol family. The protocol is used to retrieve news from news server, a.k.a. NetNews servers. The protocol works by posting messages into various forums, a.k.a. newsgroups. Then other end-users can read the recent posts in the forums. There also exist protocols for distributing NetNews contents amongst various NetNews servers, allowing thousands of servers to share news and forums. The most popular news server is of course Microsoft's [nntp://news.microsoft.com]. More often than not, you can launch your NetNews client by typing the nntp URL in your browser's address bar.

public class NntpException : System.ApplicationException
{
    public NntpException(string str)
        :base(str)
    {
    }
};

I'm still unsure how best to implement exception classes in .NET and as such I've remained faithful to my C++ roots. I'm investigating otherwise and might consider writing a brief article on just this subject. We'll see. Next step is the class declaration. I'm deriving the Nntp class from the TcpClient class in the System.Net.Sockets namespace of the .NET framework.

public class Nntp : System.Net.Sockets.TcpClient

We'll inherit a lot of basic functionality from the TcpClient class.

Randy's article are Copyright 1998-2003 Randy Charles Morin

Comments

  • Re: [4472] How to NNTP in C#

    Posted by RonaldJJames on 08 Apr 2006

    Great article - thanks. 


    However I'd like to post HTML to an NNTP server.  I'm assuming that I need to specify this in the Header info somehow but can't find any documentation on...

  • The Only Problem...

    Posted by iancaz on 20 Apr 2005

    The only problem I found with this article, was the missing "Supporting Functions" you included in your other programs. Other than that, this is an awesome article! Keep up the good work!

  • Excellent tutorial

    Posted by alberto1964 on 01 Oct 2004


    This saved me days of work ! Thanks, really excellent.