Esempio n. 1
0
        public ProcessingResult Processing_Type = ProcessingResult.TextHtml; //{ get; set; }

        internal void AddRequestHeader(StringS hp)
        {
            if (hp == null)
            {
                return;
            }
            if (hp.id.Length < 0)
            {
                return;
            }

            // uncomment to prevent multi headers
            //int i = 0;
            //foreach (StringS h in this.RequestHeaders)
            //{
            //    if (h.id == hp.id)
            //    {
            //        this.RequestHeaders[i].value=(hp.value);
            //        return;
            //    }
            //    i++;

            //}
            this.Request_Headers.Add(hp);
        }
Esempio n. 2
0
        internal void SaveRequestHeaders(System.Collections.Specialized.NameValueCollection nameValueCollection)
        {
            // user-agent:fox
            // cookie;id=5
            //cooki=user=ger;date=15
            StringS h = new StringS();

            foreach (string key in nameValueCollection.AllKeys)
            {
                h.id = key.Trim();
                string[] values = nameValueCollection.GetValues(key);
                if (values.Length < 1)
                {
                    continue;
                }

                if (h.id.ToLower() == "cookie")
                {
                    this.ParseCookie(values[0]);
                    continue;
                }
                this.AddRequestHeader(h);
            }
        }