HTTP服务器软件系统的设计与实现(15)
时间:2017-02-21 13:09 来源:毕业论文 作者:毕业论文 点击:次
/// /// 单独请求路径可能查询网址 /// 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) |