/// <summary>
        ///     Gets Browser Cap Info
        /// </summary>
        /// <param name="capabilities">Browser capabilities</param>
        /// <returns>The new VNameValueCollection</returns>
        public static VNameValueCollection ToVNameValueCollection(this HttpCapabilitiesBase capabilities)
        {
            var browsercollection = new VNameValueCollection();

            if (capabilities != null)
            {
                browsercollection.Add(new VKeyValue("Browser", capabilities.Browser));
                browsercollection.Add(new VKeyValue("EcmaScriptVersion", capabilities.EcmaScriptVersion.ToString()));
                browsercollection.Add(new VKeyValue("MajorVersion", capabilities.MajorVersion.ToString(CultureInfo.InvariantCulture)));
                browsercollection.Add(new VKeyValue("MinorVersion", capabilities.MinorVersion.ToString(CultureInfo.InvariantCulture)));
                browsercollection.Add(new VKeyValue("MSDomVersion", capabilities.MSDomVersion.ToString()));
                browsercollection.Add(new VKeyValue("Platform", capabilities.Platform));
                browsercollection.Add(new VKeyValue("Type", capabilities.Type));
                browsercollection.Add(new VKeyValue("Version", capabilities.Version));
                browsercollection.Add(new VKeyValue("W3CDomVersion", capabilities.W3CDomVersion.ToString()));
                browsercollection.Add(new VKeyValue("ActiveXControls", capabilities.ActiveXControls.ToString(CultureInfo.InvariantCulture)));
                browsercollection.Add(new VKeyValue("AOL", capabilities.AOL.ToString(CultureInfo.InvariantCulture)));
                browsercollection.Add(new VKeyValue("Beta", capabilities.Beta.ToString(CultureInfo.InvariantCulture)));
                browsercollection.Add(new VKeyValue("Cookies", capabilities.Cookies.ToString(CultureInfo.InvariantCulture)));
                browsercollection.Add(new VKeyValue("Crawler", capabilities.Crawler.ToString(CultureInfo.InvariantCulture)));
                browsercollection.Add(new VKeyValue("Frames", capabilities.Frames.ToString(CultureInfo.InvariantCulture)));
            }

            return browsercollection;
        }
        /// <summary>
        ///     Copy HttpCookieCollection to XmlSerializable VKeyValue array.
        /// </summary>
        /// <param name="cookies">HTTP cookies.</param>
        /// <returns>The new VNameValueCollection</returns>
        public static VNameValueCollection ToVNameValueCollection(this HttpCookieCollection cookies)
        {
            var collection = new VNameValueCollection();

            if (cookies != null && cookies.Count > 0)
            {
                for (int i = 0; i < cookies.Count; i++)
                {
                    HttpCookie cookie = cookies[i];
                    collection.Add(new VKeyValue
                                       {
                                           Key = cookie.Name,
                                           Value = cookie.Value
                                       });
                }
            }

            return collection;
        }
        /// <summary>
        /// Gets a Application state
        /// </summary>
        /// <param name="applicationstate">The application state.</param>
        /// <returns>The new VNameValueCollection</returns>
        public static VNameValueCollection ToVNameValueCollection(this HttpApplicationState applicationstate)
        {
            var results = new VNameValueCollection();

            if (applicationstate != null)
            {
                for (int i = 0; i < applicationstate.Count; i++)
                {
                    results.Add(new VKeyValue(applicationstate.GetKey(i), string.Concat(applicationstate.Get(i))));
                }
            }

            return results;
        }
        /// <summary>
        /// Gets a Application session state
        /// </summary>
        /// <param name="session">The session.</param>
        /// <returns>The new VNameValueCollection</returns>
        public static VNameValueCollection ToVNameValueCollection(this HttpSessionState session)
        {
            var results = new VNameValueCollection();

            if (session != null)
            {
                NameObjectCollectionBase.KeysCollection keys = session.Keys;
                if (keys.Count > 0)
                {
                    for (int i = 0; i < keys.Count; i++)
                    {
                        results.Add(new VKeyValue(keys[i], string.Concat(session[i])));
                    }
                }
            }

            return results;
        }