C# 整理
1、获取url字符串中的参数
/// <summary> /// 从url里获取参数 /// </summary> /// <param name="url">url</param> /// <param name="key">参数key</param> /// <returns>参数value</returns> private string GetUrlParamValue(string url,string key) { Regex urlRegex = new Regex(@"(?:^|/?|&)" + key + "=([^&]*)(?:&|$)"); Match m = urlRegex.Match(url.ToLower()); string value = string.Empty; if (m.Success) { value = m.Groups[1].Value; } return value; }