Exemplo n.º 1
0
        private void RemoveCookies(StringCollection requestHeader)
        {
            HeaderFieldList fieldList = new HeaderFieldList();

            HeaderFieldList.GetHeaderFieldList(0, requestHeader, fieldList);
            for (int i = fieldList.Count - 1; i >= 0; i--)
            {
                HeaderField field = fieldList[i];
                if (string.Compare(field.Name, "cookie", true, CultureInfo.InvariantCulture) == 0)
                {
                    HeaderFieldList.RemoveHeaderField(requestHeader, fieldList, field);
                }
            }
        }
Exemplo n.º 2
0
        public static void RemoveHeaderField(ArrayList source, HeaderFieldList fieldList, string name)
        {
            HeaderField field = fieldList[name];

            if (field != null)
            {
                fieldList.Remove(field);
                int index = int.Parse(field.Value);
                source.RemoveAt(index);
                while (index < source.Count)
                {
                    string str = (string)source[index];
                    if (StringUtils.IsEmpty(str) || ((str[0] != '\t') && (str[0] != ' ')))
                    {
                        break;
                    }
                    source.RemoveAt(index);
                }
            }
        }
Exemplo n.º 3
0
 public static void RemoveHeaderField(StringCollection source, HeaderFieldList fieldList, HeaderField field)
 {
     if (field != null)
     {
         fieldList.Remove(field);
         int index = int.Parse(field.Value);
         source.RemoveAt(index);
         while (index < source.Count)
         {
             if (StringUtils.IsEmpty(source[index]) || ((source[index][0] != '\t') && (source[index][0] != ' ')))
             {
                 break;
             }
             source.RemoveAt(index);
         }
     }
 }
Exemplo n.º 4
0
 public void Remove(HeaderField field)
 {
     this.list.Remove(field);
 }
Exemplo n.º 5
0
 public void Add(HeaderField field)
 {
     this.list.Add(field);
 }