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