Beispiel #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.Add(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.Add(name, System.Net.WebUtility.UrlDecode(value));
                }
            }
        }
Beispiel #2
0
 internal void Add(string name, string value)
 {
     mDataContext.Add(name, System.Web.HttpUtility.UrlDecode(value));
 }