Exemplo n.º 1
0
        /// <summary>
        /// 解析post请求
        /// </summary>
        public void ParsePostRequest(string content)
        {
            if (string.IsNullOrEmpty(content))
            {
                return;
            }

            string[] arrs = content.Split('&');
            if (arrs == null || arrs.Length == 0)
            {
                return;
            }

            for (int i = 0; i < arrs.Length; ++i)
            {
                string[] arr = arrs[i].Split('=');
                if (arr == null || arr.Length != 2)
                {
                    continue;
                }
                sRequestInfo info = new sRequestInfo();
                info.key   = arr[0];
                info.value = arr[1];
                lock (m_lock_obj)
                {
                    m_request_args.Enqueue(info);
                }
            }
        }
Exemplo n.º 2
0
 /// <summary>
 /// 解析get请求
 /// </summary>
 /// <param name="QueryString"></param>
 public void ParseGetRequest(NameValueCollection QueryString)
 {
     for (int i = 0; i < QueryString.Count; ++i)
     {
         sRequestInfo info = new sRequestInfo();
         info.key   = QueryString.GetKey(i);
         info.value = QueryString.Get(i);
         lock (m_lock_obj)
         {
             m_request_args.Enqueue(info);
         }
     }
 }
Exemplo n.º 3
0
        public void Update()
        {
            int count = 0;

            while (this.HasArgs() && count++ < 100)
            {
                sRequestInfo info = this.PopArgs();
                if (string.IsNullOrEmpty(info.key) || string.IsNullOrEmpty(info.value))
                {
                    continue;
                }
                //switch(info.key)
                //{
                //    //TODO
                //}
            }
        }