毕业论文

打赏
当前位置: 毕业论文 > 计算机论文 >

HTTP服务器软件系统的设计与实现(15)

时间:2017-02-21 13:09来源:毕业论文
/// /// 单独请求路径可能查询网址 /// string[] subPaths = subparts[1].Split(new string[] { ? }, StringSplitOptions.RemoveEmptyEntries); req.Path = subPaths[0]; req.Paths = subPaths[0].Spl



                        ///
                        /// 单独请求路径可能查询网址
                        ///
                        string[] subPaths = subparts[1].Split(new string[] { "?" }, StringSplitOptions.RemoveEmptyEntries);
                        
                        req.Path = subPaths[0];                        
                        req.Paths = subPaths[0].Split(new string[] { "/" }, StringSplitOptions.RemoveEmptyEntries).ToList();
                    }
                }

                //保存在字典中查询网址:req.UrlParameters
                string[] queryparams = HttpHelper.GetUrlQueries(HttpHelper.RemoveToken(req.CompletePath));
                foreach (string p in queryparams)
                {
                    string[] query = p.Split(new String[] { "=" }, StringSplitOptions.RemoveEmptyEntries);
                    if (query.Length == 2)
                    {
                        req.UrlParameters.Add(query[0], query[1]);
                    }
                }
            }
            catch (Exception)
            {
                //如果somethig出错验证返回false。
                req = null;
                return false;
            }
            req.Type = request;
            return true;
        }
HTTP服务器软件系统的设计与实现(15):http://www.751com.cn/jisuanji/lunwen_3170.html
------分隔线----------------------------
推荐内容