Example #1
0
 /// <summary>
 /// Retrieves the article body at the position specified by the current article pointer.
 /// </summary>
 /// <returns>A byte array containing the article body.</returns>
 /// <example>
 /// <code>
 /// C#
 ///
 /// NntpClient nntp = new NntpClient();
 ///
 /// nntp.Connect("news.myhost.com");
 ///
 /// NewsGroup group = nntp.SelectGroup("mygroup");
 /// //Retrieve the first body in this group.
 /// byte[] body = group.RetrieveBody();
 ///
 /// nntp.Disconnect();
 ///
 /// VB.NET
 ///
 /// Dim nntp As New NntpClient
 ///
 /// nntp.Connect("news.myhost.com")
 ///
 /// Dim group As NewsGroup = nntp.SelectGroup("mygroup")
 /// 'Retrieve the first body in this group.
 /// Dim body() As Byte = group.RetrieveBody()
 ///
 /// nntp.Disconnect()
 ///
 /// JScript.NET
 ///
 /// var nntp:NntpClient = new NntpClient();
 ///
 /// nntp.Connect("news.myhost.com");
 ///
 /// var group:NewsGroup = nntp.SelectGroup("mygroup");
 /// //Retrieve the first body in this group.
 /// var body:byte[] = group.RetrieveBody();
 /// nntp.Disconnect();
 /// </code>
 /// </example>
 public byte[] RetrieveBody()
 {
     if (Pointer != 0 & Pointer != -1)
     {
         return(_nntp.CommandMultiline("body"));
     }
     else
     {
         Pointer = FirstArticle;
         return(_nntp.CommandMultiline("body " + FirstArticle.ToString()));;
     }
 }
Example #2
0
 /// <summary>
 /// Retrieves the article Header at the position specified by the current article pointer.
 /// </summary>
 /// <returns>A byte array containing the article header.</returns>
 /// <example>
 /// <code>
 /// C#
 ///
 /// NntpClient nntp = new NntpClient();
 ///
 /// nntp.Connect("news.myhost.com");
 ///
 /// NewsGroup group = nntp.SelectGroup("mygroup");
 /// //Retrieve the first Header in this group.
 /// byte[] Header = group.RetrieveHeader();
 ///
 /// nntp.Disconnect();
 ///
 /// VB.NET
 ///
 /// Dim nntp As New NntpClient
 ///
 /// nntp.Connect("news.myhost.com")
 ///
 /// Dim group As NewsGroup = nntp.SelectGroup("mygroup")
 /// 'Retrieve the first Header in this group.
 /// Dim header() As Byte = group.RetrieveHeader()
 ///
 /// nntp.Disconnect()
 ///
 /// JScript.NET
 ///
 /// var nntp:NntpClient = new NntpClient();
 ///
 /// nntp.Connect("news.myhost.com");
 ///
 /// var group:NewsGroup = nntp.SelectGroup("mygroup");
 /// //Retrieve the first Header in this group.
 /// var header:byte[] = group.RetrieveHeader();
 /// nntp.Disconnect();
 /// </code>
 /// </example>
 public byte[] RetrieveHeader()
 {
     if (Pointer != 0 & Pointer != -1)
     {
         return(_nntp.CommandMultiline("head"));
     }
     else
     {
         Pointer = FirstArticle;
         _nntp.OnHeaderRetrieving(new HeaderRetrievingEventArgs(Pointer));
         byte[] buffer = _nntp.CommandMultiline("head " + FirstArticle.ToString());
         _nntp.OnHeaderRetrieved(new HeaderRetrievedEventArgs(buffer, Pointer));
         return(buffer);
     }
 }
Example #3
0
 /// <summary>
 /// Retrieves the article at the position specified by the current article pointer.
 /// </summary>
 /// <returns>A byte array containing the article data.</returns>
 /// <example>
 /// <code>
 /// C#
 ///
 /// NntpClient nntp = new NntpClient();
 ///
 /// nntp.Connect("news.myhost.com");
 ///
 /// NewsGroup group = nntp.SelectGroup("mygroup");
 /// //Retrieve the first article in this group.
 /// byte[] article = group.RetrieveArticle();
 ///
 /// nntp.Disconnect();
 ///
 /// VB.NET
 ///
 /// Dim nntp As New NntpClient
 ///
 /// nntp.Connect("news.myhost.com")
 ///
 /// Dim group As NewsGroup = nntp.SelectGroup("mygroup")
 /// 'Retrieve the first article in this group.
 /// Dim article() As Byte = group.RetrieveArticle()
 ///
 /// nntp.Disconnect()
 ///
 /// JScript.NET
 ///
 /// var nntp:NntpClient = new NntpClient();
 ///
 /// nntp.Connect("news.myhost.com");
 ///
 /// var group:NewsGroup = nntp.SelectGroup("mygroup");
 /// //Retrieve the first article in this group.
 /// var article:byte[] = group.RetrieveArticle();
 /// nntp.Disconnect();
 /// </code>
 /// </example>
 public byte[] RetrieveArticle()
 {
     if (Pointer != 0 & Pointer != -1)
     {
         return(_nntp.CommandMultiline("article"));
     }
     else
     {
         Pointer = FirstArticle;
         _nntp.OnMessageRetrieving(new MessageRetrievingEventArgs(Pointer));
         byte[] buffer = _nntp.CommandMultiline("article " + FirstArticle.ToString());
         _nntp.OnMessageRetrieved(new MessageRetrievedEventArgs(buffer, Pointer));
         return(buffer);
     }
 }