ParseHeaderField() public method

Parse header specified header field value.
public ParseHeaderField ( string fieldName ) : string
fieldName string Header field which to parse. Eg. Subject: .
return string
Exemplo n.º 1
0
        /// <summary>
        /// Parse encoding.
        /// </summary>
        /// <param name="headers"></param>
        /// <returns></returns>
        private string ParseEncoding(string headers)
        {
            string encoding = MimeParser.ParseHeaderField("CONTENT-TRANSFER-ENCODING:", headers);

            if (encoding.Length > 0)
            {
                return(encoding);
            }
            // If no encoding, consider it as ascii
            else
            {
                return("7bit");
            }
        }
Exemplo n.º 2
0
        private Disposition ParseContentDisposition(string headers)
        {
            string disposition = MimeParser.ParseHeaderField("CONTENT-DISPOSITION:", headers);

            if (disposition.ToUpper().IndexOf("ATTACHMENT") > -1)
            {
                return(Disposition.Attachment);
            }

            if (disposition.ToUpper().IndexOf("INLINE") > -1)
            {
                return(Disposition.Inline);
            }

            return(Disposition.Unknown);
        }