/// <summary> /// z 'ala="123"' /// </summary> /// <param name="key">ala=</param> /// <returns>123</returns> protected string GetValueEqualFromHeader2(string key) { bool noQuotes = false; int end = -1; int start = header.IndexOf(key); if (start == -1) { return(""); } start = header.IndexOf('"', start); if (start == -1) { noQuotes = true; start = header.IndexOf('=', header.IndexOf(key)); } if (noQuotes) { end = header.IndexOf("\r\n", start + 1); } else { end = header.IndexOf('"', start + 1); } if (start == -1 || end == -1) { return(""); } return(QuotedCoding.Decode(header.Substring(start + 1, end - start - 1))); }
/// <summary> /// z 'ala="123"' /// </summary> /// <param name="key">ala=</param> /// <returns>123</returns> protected string GetValueEqualFromHeader(string key) { int start = header.IndexOf(key); if (start == -1) { return(""); } start = header.IndexOf('"', start); int end = header.IndexOf('"', start + 1); if (start == -1 || end == -1) { return(""); } return(QuotedCoding.Decode(header.Substring(start + 1, end - start - 1))); }
protected string GetValueFromHeader(string key) { int start = header.ToLower().IndexOf(key.ToLower()); if (start < 0) { return(""); } start = header.IndexOf(' ', start); if (start < 0) { return(""); } int end = header.IndexOf("\r\n", start); if (end <= 0) { return(""); } return(QuotedCoding.Decode(header.Substring(start + 1, end - start - 1).Trim())); }