标签:blog io ar sp for on div art log
/// <summary> /// 获取url中的查询字符串参数 /// </summary> public static NameValueCollection ExtractQueryParams(string url) { int startIndex = url.IndexOf("?"); NameValueCollection values = new NameValueCollection(); if (startIndex <= 0) return values; string[] nameValues = url.Substring(startIndex + 1).Split(‘&‘); foreach (string s in nameValues) { string[] pair = s.Split(‘=‘); string name = pair[0]; string value = string.Empty; if (pair.Length > 1) value = pair[1]; values.Add(name, value); } return values; }
标签:blog io ar sp for on div art log
原文地址:http://www.cnblogs.com/huanchen/p/4129200.html