Example #1
0
        /// <summary>
        /// Uidls the specified list.
        /// </summary>
        /// <param name="List">The list.</param>
        public void Uidl(Pop3MessageInfoList List)
        {
            Pop3UIDInfoList pop3UIDLInfoList = this.Uidl();

            for (int iIndex = 0; iIndex < pop3UIDLInfoList.Count; iIndex++)
            {
                List[iIndex].UID = pop3UIDLInfoList[iIndex].UID;
            }
        }
Example #2
0
        /// <summary>
        /// Uidls this instance.
        /// </summary>
        /// <returns></returns>
        public Pop3UIDInfoList Uidl()
        {
            this.SendCommand("UIDL\r\n");
            string uidlResponse = this.ReadOKResponse();

            Pop3UIDInfoList list = new Pop3UIDInfoList();

            while (true)
            {
                string responseLine = ReadLine();

                if (responseLine.StartsWith("."))
                {
                    break;
                }

                string[] NumArray = responseLine.Split(_Delimiter);
                if (NumArray.Length != 2)
                {
                    throw new Pop3ServerIncorectAnswerException();
                }

                Pop3UIDInfo message = null;

                try
                {
                    message = new Pop3UIDInfo(Int32.Parse(NumArray[0]), NumArray[1]);
                }
                catch (Exception ex)
                {
                    throw new Pop3ServerIncorectAnswerException("Incorect response format.", ex);
                }

                list.Add(message);
            }
            return(list);
        }
Example #3
0
        /// <summary>
        /// Uidls this instance.
        /// </summary>
        /// <returns></returns>
        public Pop3UIDInfoList Uidl()
        {
            this.SendCommand("UIDL\r\n");
            string uidlResponse = this.ReadOKResponse();

            Pop3UIDInfoList list = new Pop3UIDInfoList();

            while (true)
            {
                string responseLine = ReadLine();

                if (responseLine.StartsWith("."))
                    break;

                string[] NumArray = responseLine.Split(_Delimiter);
                if (NumArray.Length != 2)
                    throw new Pop3ServerIncorectAnswerException();

                Pop3UIDInfo message = null;

                try
                {
                    message = new Pop3UIDInfo(Int32.Parse(NumArray[0]), NumArray[1]);
                }
                catch (Exception ex)
                {
                    throw new Pop3ServerIncorectAnswerException("Incorect response format.", ex);
                }

                list.Add(message);
            }
            return list;
        }