HTTP服务器软件系统的设计与实现(15)_毕业论文

毕业论文移动版

毕业论文 > 计算机论文 >

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



                        ///
                        /// 单独请求路径可能查询网址
                        ///
                        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;
        }
(责任编辑:qin)