⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 nntppost.cs

📁 本系统是在asp版《在线文件管理器》的基础上设计制作
💻 CS
字号:
//------------------------------------------------------------------------------
// <copyright company="Telligent Systems">
//     Copyright (c) Telligent Systems Corporation.  All rights reserved.
// </copyright> 
//------------------------------------------------------------------------------

using System;
using System.Collections;

namespace AspNetForums.Components {

    // *******************************************************
    // NntpPost
    /// <summary>
    /// Class used to model an NNTP message
    /// </summary>
    // *******************************************************
    public class NntpPost {

        Hashtable  headers;
        string     body;
        string     articleID;

        public NntpPost() {
            this.headers = new Hashtable();
        }

        public NntpPost(String articleID, Hashtable headers, string body) {

            this.articleID = articleID;
            this.headers = headers;
            this.body = body;

        }

        public Hashtable Headers {
            get {
                return headers;
            }
        }

        public String Body {
            get {
                return body; 
            }
            set {
                body = value;
            }
        }

        public String ArticleID {
            get {
                return articleID; 
            }
            set {
                articleID = value;
            }
        }

        public string[] ReferenceIDs {
            get {
                if ( headers["references"] != null)
                    return ((string) headers["references"]).Split(',');

                return new string[0];
            }
            set {
                headers["references"] = value;
            }
        }

        public String NntpUniqueID {
            get {
                return ((String)headers["message-id"]).Trim(); 
            }
            set {
                headers["message-id"] = value;
            }
        }

        public int PostID {
            get {
                return Int32.Parse(ArticleID.Substring(0, ArticleID.IndexOf(" "))); 
            }
        }

        public String PostDate {
            get {
                string messageDateUnformatted = ((String) Headers["date"]).Trim();
                int length = messageDateUnformatted.Length;

                // Parse the Message Date
                //
                string offSet = messageDateUnformatted.Substring((length - 5), 5);


                return messageDateUnformatted.Substring(0, (length - 5));
            }

        }

        public String From {
            get {
                return ((String) headers["from"]).Trim(); 
            }
            set {
                headers["from"] = value;
            }
        }


        public String Subject {
            get {
                return ((String) headers["subject"]).Trim(); 
            }
            set {
                headers["subject"] = value;
            }
        }
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -