//獲取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; } }