Пример #1
0
        /// <summary>
        /// Retrieves the new newsgroups.
        /// </summary>
        /// <param name="dateTime">The value time.</param>
        /// <param name="timeZone">The time zone.</param>
        /// <param name="distributions">The distributions.</param>
        /// <returns></returns>
        public virtual IEnumerable<NewsgroupHeader> RetrieveNewNewsgroups(DateTime dateTime, TimeZoneOption timeZone, string distributions)
        {
            string command = string.Format("NEWGROUPS {0:yyMMdd} {0:HHmmss}", dateTime);
            if (timeZone == TimeZoneOption.UseGreenwichMeanTime)
            {
                command += " GMT";
            }

            if (!string.IsNullOrEmpty(distributions))
            {
                command += " ";
                command += distributions;
            }

            foreach (string s in DoBasicCommand(command, Rfc977ResponseCodes.NewNewsgroupsFollow))
            {
                yield return NewsgroupHeader.Parse(s);
            }
        }
Пример #2
0
        /// <summary>
        /// Retrieves the new news.
        /// </summary>
        /// <param name="newsgroupWildcardMatch">The newsgroup wildcard match.</param>
        /// <param name="dateTime">The value time.</param>
        /// <param name="timeZone">The time zone.</param>
        /// <param name="distributions">The distributions.</param>
        /// <returns></returns>
        public virtual IEnumerable<string> RetrieveNewNews(string newsgroupWildcardMatch, DateTime dateTime, TimeZoneOption timeZone, string distributions)
        {
            string command = string.Format("NEWNEWS {0} {1:yyMMdd} {1:HHmmss}", newsgroupWildcardMatch, dateTime);
            if (timeZone == TimeZoneOption.UseGreenwichMeanTime)
            {
                command += " GMT";
            }

            if (!string.IsNullOrEmpty(distributions))
            {
                command += " ";
                command += distributions;
            }

            foreach (string s in DoBasicCommand(command, Rfc977ResponseCodes.NewArticlesFollow))
            {
                yield return s;
            }
        }