newsreader

  • Thread starter Thread starter pesso
  • Start date Start date
Look for the RFC 977 and 2980.
There is also a useful article called "How to NNTP in C#". I can't remember where I got it from, but it was easy to find using common search engines.

Mike


How can I write a newsreader in .NET?
 
Hi, pesso

Go ogle for RFCs related to protocols and implement them

Should be simple enough

HTH
Alex
 
pesso said:
How can I write a newsreader in .NET?

Hi pesso,

there is already an implementation of an ADO.NET Data Provider for NNTP
by Dirk_Primbs [MS].

http://workspaces.gotdotnet.com/nntpClient

This library allows you to code like this:

- Simple access using a DataReader:

NntpConnection cn = new NntpConnection("news.microsoft.com");
NntpCommand cmd = new NntpCommand("select top 10 * from
microsoft.public.dotnet.languages.csharp", cn);
cn.Open();
NntpDataReader reader = cmd.ExecuteReader();
while(reader.Read())
Console.WriteLine("{0}\t{1}\n", reader.GetString("From"),
reader.GetString("Subject"));
cn.Close();

- Getting a DataSet:

DataSet ds = new DataSet();

NntpConnection cn = new NntpConnection("news.microsoft.com");
NntpCommand cmd = new NntpCommand("select top 10 * from
microsoft.public.dotnet.languages.csharp", cn);

NntpDataAdapter da = new NntpDataAdapter(cmd);
da.Fill(ds);

It is also possible to post a message:

NntpPosting:
NntpConnection cn = new NntpConnection("news.microsoft.com");
cn.Open();
NntpPosting p = new NntpPosting("Arne Janning",
"(e-mail address removed)", "Re: fourtytwo", "This is a test.",
"microsoft.test");
p.Post(cn);
cn.Close();

If you use the DataAdapter, just call the Update()-Method.

Cheers

Arne Janning
 
Back
Top