Ejemplo n.º 1
0
        public static void AsynczeFromUrlEncoded(ReadOnlySpan <char> url, Data.IDataContext context)
        {
            int    offset = 0;
            string name = null, value = null;

            for (int i = 0; i < url.Length; i++)
            {
                if (url[i] == '=')
                {
                    name   = new string(url.Slice(offset, i - offset));
                    offset = i + 1;
                }
                if (name != null && url[i] == '&')
                {
                    if (i > offset)
                    {
                        value = new string(url.Slice(offset, i - offset));
                        context.SetValue(name, System.Net.WebUtility.UrlDecode(value));
                        offset = i + 1;
                    }
                    name = null;
                }
            }
            if (name != null)
            {
                if (url.Length > offset)
                {
                    value = new string(url.Slice(offset, url.Length - offset));
                    context.SetValue(name, System.Net.WebUtility.UrlDecode(value));
                }
            }
        }
Ejemplo n.º 2
0
 internal void Add(string name, string value)
 {
     mDataContext.SetValue(name, System.Web.HttpUtility.UrlDecode(value));
 }