📄 querystring.cs
字号:
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
/// <summary>
/// 此类主要接受QueryString对象,返回结果
/// </summary>
public class QueryString
{
public QueryString()
{
//
// TODO: 在此处添加构造函数逻辑
//
}
/// <summary>
/// 获取ID
/// </summary>
static public string GetId { get { return (HttpContext.Current.Request.QueryString["id"] == null) ? null : vldInput(System.Web.HttpContext.Current.Request.QueryString["id"]); } }
/// <summary>
/// 获取短信ID
/// </summary>
static public string GetMid { get { return (HttpContext.Current.Request.QueryString["mid"] == null) ? null : vldInput(System.Web.HttpContext.Current.Request.QueryString["mid"]); } }
/// <summary>
/// 获取大类ID
/// </summary>
static public string GetBigId { get { return (HttpContext.Current.Request.QueryString["bigid"] == null) ? null : vldInput(System.Web.HttpContext.Current.Request.QueryString["bigid"]); } }
/// <summary>
/// 获取小类ID
/// </summary>
static public string GetSmallId { get { return (HttpContext.Current.Request.QueryString["smallid"] == null) ? null : vldInput(System.Web.HttpContext.Current.Request.QueryString["smallid"]); } }
/// <summary>
/// 获取主题ID
/// </summary>
static public string GetThemeId { get { return (HttpContext.Current.Request.QueryString["themeid"] == null) ? null : vldInput(System.Web.HttpContext.Current.Request.QueryString["themeid"]); } }
/// <summary>
/// 获取回复ID
/// </summary>
static public string GetBackId { get { return (HttpContext.Current.Request.QueryString["backid"] == null) ? null : vldInput(System.Web.HttpContext.Current.Request.QueryString["backid"]); } }
/// <summary>
/// 获取分页ID
/// </summary>
static public string GetPageId { get { return (HttpContext.Current.Request.QueryString["page"] == null) ? "1" : vldInput(System.Web.HttpContext.Current.Request.QueryString["page"]); } }
static private string vldInput(string strId)
{
try
{
int.Parse(strId);
return strId;
}
catch { HttpContext.Current.Response.Redirect("Default.aspx"); return ""; }
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -