获得参数id的Long值,如果找不到或格式不正确,返回0 - GetLongIDParameter
2017-05-16 09:04:08 访问(1404) 赞(0) 踩(0)
/// <summary>
/// 获得参数id的Long值,如果找不到或格式不正确,返回0 - GetLongIDParameter
/// </summary>
/// <returns></returns>
public static long GetLongIDParameter()
{
string theValue = HttpContext.Current.Request.QueryString["id"];
if (theValue == null || theValue.Length == 0)
return 0;
long theResult = 0;
if (long.TryParse(theValue, out theResult))
return theResult;
return 0;
}
标签:
获得参数id的Long值,如果找不到或格式不正确,返回0 - GetLongIDParameter 


上一条:
下一条:
相关评论
发表评论