using System; using System.IO; namespace Ant.Service.Utilities { /// /// This class represents the Pop3 PASS command. /// internal sealed class PassCommand : Pop3Command { private string _password; /// /// Initializes a new instance of the class. /// /// The stream. /// The password. public PassCommand(Stream stream, string password) : base(stream, false, Pop3State.Authorization) { if (string.IsNullOrEmpty(password)) { throw new ArgumentNullException("password"); } _password = password; } /// /// Creates the PASS request message. /// /// /// The byte[] containing the PASS request message. /// protected override byte[] CreateRequestMessage() { return GetRequestMessage(Pop3Commands.Pass, _password, Pop3Commands.Crlf); } } }