Example #1
0
        /// POP3メールサーバーへUIDLコマンドを送信します。
        /// <summary>
        /// Send uidl command to pop3 server.
        /// POP3メールサーバーへUIDLコマンドを送信します。
        /// </summary>
        /// <returns></returns>
        public List <UidlCommandResult> ExecuteUidl()
        {
            UidlCommand cm              = new UidlCommand();
            List <UidlCommandResult> l  = new List <UidlCommandResult>();
            Pop3CommandResult        rs = null;
            StringReader             sr = null;
            String line = "";

            this.CheckAuthenticate();
            rs = this.Execute(cm);
            this.CheckResponseError(rs);

            sr = new StringReader(rs.Text);
            while (sr.Peek() > -1)
            {
                line = sr.ReadLine();
                if (line == ".")
                {
                    break;
                }
                if (line.StartsWith("+OK", StringComparison.OrdinalIgnoreCase) == true)
                {
                    continue;
                }

                l.Add(new UidlCommandResult(line));
            }
            return(l);
        }
Example #2
0
        /// 非同期でPOP3メールサーバーへUIDLコマンドを送信します。
        /// <summary>
        /// Send asynchronous uidl command to pop3 server.
        /// 非同期でPOP3メールサーバーへUIDLコマンドを送信します。
        /// </summary>
        /// <param name="callbackFunction"></param>
        public void ExecuteUidl(Action <List <UidlCommandResult> > callbackFunction)
        {
            UidlCommand cm = new UidlCommand();

            Action <Pop3CommandResult> md = response =>
            {
                this.CheckResponseError(response);
                List <UidlCommandResult> l  = new List <UidlCommandResult>();
                StringReader             sr = null;
                String line = "";

                sr = new StringReader(response.Text);
                while (sr.Peek() > -1)
                {
                    line = sr.ReadLine();
                    if (line == ".")
                    {
                        break;
                    }
                    if (line.StartsWith("+OK", StringComparison.OrdinalIgnoreCase) == true)
                    {
                        continue;
                    }

                    l.Add(new UidlCommandResult(line));
                }
                callbackFunction(l);
            };

            this.CheckAuthenticate();
            this.BeginExecute(cm, md);
        }
Example #3
0
        /// POP3メールサーバーへUIDLコマンドを送信します。
        /// <summary>
        /// Send uidl command to pop3 server.
        /// POP3メールサーバーへUIDLコマンドを送信します。
        /// </summary>
        /// <param name="mailIndex"></param>
        /// <returns></returns>
        public UidlCommandResult ExecuteUidl(Int64 mailIndex)
        {
            UidlCommand       cm = new UidlCommand(mailIndex);
            Pop3CommandResult rs = null;

            this.CheckAuthenticate();
            rs = this.Execute(cm);
            this.CheckResponseError(rs);

            return(new UidlCommandResult(rs.Text));
        }
Example #4
0
        /// POP3メールサーバーへUIDLコマンドを送信します。
        /// <summary>
        /// Send uidl command to pop3 server.
        /// POP3メールサーバーへUIDLコマンドを送信します。
        /// </summary>
        /// <param name="mailIndex"></param>
        /// <returns></returns>
        public UidlCommandResult ExecuteUidl(Int64 mailIndex)
        {
            UidlCommand       cm = new UidlCommand(mailIndex);
            UidlCommandResult rs = null;
            String            s  = "";

            this.CheckAuthenticate();
            s = this.Execute(cm);
            this.CheckResponseError(s);

            rs = new UidlCommandResult(s);
            return(rs);
        }
Example #5
0
        /// 非同期でPOP3メールサーバーへUIDLコマンドを送信します。
        /// <summary>
        /// Send asynchronous uidl command to pop3 server.
        /// 非同期でPOP3メールサーバーへUIDLコマンドを送信します。
        /// </summary>
        /// <param name="mailIndex"></param>
        /// <param name="callbackFunction"></param>
        public void ExecuteUidl(Int64 mailIndex, Action <UidlCommandResult[]> callbackFunction)
        {
            UidlCommand cm = new UidlCommand(mailIndex);

            Action <Pop3CommandResult> md = response =>
            {
                this.CheckResponseError(response);
                UidlCommandResult[] rs = new UidlCommandResult[1];
                rs[0] = new UidlCommandResult(response.Text);
                callbackFunction(rs);
            };

            this.CheckAuthenticate();
            this.BeginExecute(cm, md);
        }