private string GetBody( ) { if (String.IsNullOrEmpty(Message)) { throw new Pop3Exception("Message can't be null"); } string body = Message.Remove(0, (Message.IndexOf("\r\n\r\n"))); if (String.Compare(ContentTransferEncoding, "base64", true) == 0) { return(Base64EncodingHelper.Decode(body)); } else { return(body); } }
private string GetBody( ) { if (String.IsNullOrEmpty(RawMessage)) { return(String.Empty); } else { string body = RawMessage.Remove(0, (RawMessage.IndexOf("\r\n\r\n", StringComparison.OrdinalIgnoreCase))); try { return(String.Compare(ContentTransferEncoding, "base64", StringComparison.OrdinalIgnoreCase) == 0 ? Base64EncodingHelper.Decode(body) : body); } catch (FormatException) { return(body); } } }
internal void ParseRawMessage() { string body; if (String.IsNullOrEmpty(this.RawMessage)) { body = String.Empty; } else { body = RawMessage.Remove(0, (this.RawMessage.IndexOf("\r\n\r\n", StringComparison.OrdinalIgnoreCase))); try { body = String.Compare(this.ContentTransferEncoding, "base64", StringComparison.OrdinalIgnoreCase) == 0 ? Base64EncodingHelper.Decode(body) : body; } catch (FormatException) { body = RawMessage.Remove(0, (this.RawMessage.IndexOf("\r\n\r\n", StringComparison.OrdinalIgnoreCase))); } } this.Body = body; }