Exemple #1
0
        /// <summary>
        /// Get mailbox status. The result is a tuple of 2 integers: (message count, mailbox size).
        /// </summary>
        public Pop3Stat Stat()
        {
            //	CLIENT: STAT
            //	SERVER: +ОК 2 320

            this.SendCommand("STAT\r\n");
            string statResponse = this.ReadOKResponse();

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

            Pop3Stat answer = null;

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

            return(answer);
        }
Exemple #2
0
        /// <summary>
        /// Get mailbox status. The result is a tuple of 2 integers: (message count, mailbox size). 
        /// </summary>
        public Pop3Stat Stat()
        {
            //	CLIENT: STAT
            //	SERVER: +ОК 2 320

            this.SendCommand("STAT\r\n");
            string statResponse = this.ReadOKResponse();

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

            Pop3Stat answer = null;

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

            return answer;
        }