System.Collections.Specialized.NameValueCollection.Clear C# (CSharp) Method

Clear() public method

public Clear ( ) : void
return void
        public virtual void Clear()
        {
            if (IsReadOnly)
                throw new NotSupportedException(SR.CollectionReadOnly);

            InvalidateCachedArrays();
            BaseClear();
        }

Usage Example

Example #1
0
        protected override string OnScrape(string url, HtmlNode elem)
        {
            var id = SelectItem(elem, "[name=id]").Attributes["value"].Value;
            var fname = SelectItem(elem, "[name=fname]").Attributes["value"].Value;
            var data = new NameValueCollection();
            data.Add("op", "download1");
            data.Add("usr_login", "");
            data.Add("id", id);
            data.Add("fname", fname);
            data.Add("method_free", "Proceed to Video");
            elem = Post(url, data);

            var rand = SelectItem(elem, "[name=rand]").Attributes["value"].Value;
            data.Clear();
            data.Add("op", "download2");
            data.Add("rand", rand);
            data.Add("id", id);
            data.Add("fname", fname);
            data.Add("method_free", "Proceed to Video");
            data.Add("method_premium", "");
            Thread.Sleep(45000);
            elem = Post(url, data);
            url = new Uri(SelectItem(elem, "#lnk_download").Attributes["href"].Value).AbsoluteUri;

            return url;
        }
All Usage Examples Of System.Collections.Specialized.NameValueCollection::Clear