//获取URL中id参数 var ids = YK.Common.Util.WebKit.QueryParamValue("ids", ""); /// <summary> /// 获取url参数的字符串类型值 /// </summary> /// <param name="key">参数名</param> /// <param name="defaultValue">如果参数不存在时的默认值</param> /// <returns>url参数的字符串类型值</returns> public static string QueryParamValue(string key, string defaultValue) { if (String.IsNullOrEmpty(key)) { throw new Exception("参数key的值为null。"); } var v = GetQueryValue(key); if (v != null) { return v.ToString(); } else { return defaultValue; } }
时间: 2025-01-15 04:24:58