示例#1
0
        public static bool ReplyTo(MailMessage article)
        {
            MessageFrm dlg = new MessageFrm();

            dlg.btnPost.Text = "Reply";

            string txt = "\r\n" + StringUtils.GetStringsAsString(article.MessageText);

            txt += txt.Replace("\r\n", "\r\n >");
            txt  = "\r\n" + txt;
            dlg.memText.Text = txt;

            if (article.Subject.ToLower().IndexOf("re:") != 0)
            {
                dlg.edtSubject.Text = "Re: " + article.Subject;
            }

            string[] refs = article.References;

            if (dlg.ShowDialog() == DialogResult.OK)
            {
                article.BuildMessage(dlg.memText.Text, "");
                article.Subject          = dlg.edtSubject.Text;
                article.From.FullAddress = dlg.edtFrom.Text;
                article.References       = refs;

                return(true);
            }
            return(false);
        }
 private void btnPostNew_Click(object sender, System.EventArgs e)
 {
     if (MessageFrm.PostNew(mailMessage1))
     {
         nntp1.PostArticle(mailMessage1, "", cbNewsGroup.Text);
     }
 }
示例#3
0
        public static bool PostNew(MailMessage article)
        {
            MessageFrm dlg = new MessageFrm();

            if (dlg.ShowDialog() == DialogResult.OK)
            {
                article.BuildMessage(dlg.memText.Text, "");
                article.Subject          = dlg.edtSubject.Text;
                article.From.FullAddress = dlg.edtFrom.Text;

                return(true);
            }
            return(false);
        }
        private void btnReply_Click(object sender, System.EventArgs e)
        {
            if (tvArticles.SelectedNode == null)
            {
                MessageBox.Show("Select article first");
                return;
            }

            nntp1.GetArticle(tvArticles.SelectedNode.Tag.ToString(), mailMessage1);

            if (MessageFrm.ReplyTo(mailMessage1))
            {
                nntp1.PostArticle(mailMessage1, tvArticles.SelectedNode.Tag.ToString(), cbNewsGroup.Text);
            }
        }