コード例 #1
0
        public override void Execute(NntpSession session)
        {
            switch (state)
            {
            case RequestState.StartingRequest:
                state = RequestState.ReceivingHeaders;
                session.Connection.SendLine("340 Send article to be posted");
                break;

            case RequestState.RequestFinished:
                using (INntpConnection connection = session.Repository.CreateConnection())
                {
                    INntpArticle article = connection.CreateArticle();

                    SetOverviewHeaders(article);
                    SetOtherHeaders(article);
                    article.Body = body.ToString();

                    connection.PostArticle(article);
                }

                session.Connection.SendLine("240 Article received OK");
                break;
            }
        }