asp.net简化接收参数值的函数
程序员文章站
2022-12-02 12:07:44
/// /// 获取querystring /// /// <...
/// <summary>
/// 获取querystring
/// </summary>
/// <param name="s">参数名</param>
/// <returns>返回值</returns>
public string q(string s)
{
if (request.querystring[s] != null)
{
return request.querystring[s].tostring();
}
return string.empty;
}
/// <summary>
/// 获取post得到的参数
/// </summary>
/// <param name="s">参数名</param>
/// <returns>返回值</returns>
protected string f(string s)
{
if (request.form[s] == null) return string.empty;
return request.form[s];
}
/// 获取querystring
/// </summary>
/// <param name="s">参数名</param>
/// <returns>返回值</returns>
public string q(string s)
{
if (request.querystring[s] != null)
{
return request.querystring[s].tostring();
}
return string.empty;
}
/// <summary>
/// 获取post得到的参数
/// </summary>
/// <param name="s">参数名</param>
/// <returns>返回值</returns>
protected string f(string s)
{
if (request.form[s] == null) return string.empty;
return request.form[s];
}