//获取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;
}
}
本文出自 “wennuanyiran” 博客,请务必保留此出处http://dingzhaoqiang.blog.51cto.com/5601059/1754783