📄 adsclick.aspx.cs
字号:
//======================================================
//== (c)2008 aspxcms inc by NeTCMS v1.0 ==
//== Forum:bbs.aspxcms.com ==
//== Website:www.aspxcms.com ==
//======================================================
using System;
using System.Data;
using System.Configuration;
using System.Collections;
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;
public partial class jsfiles_ads_adsclick : NetCMS.Web.UI.BasePage
{
protected void Page_Load(object sender, EventArgs e)
{
NetCMS.Content.Ads.Ads ac = new NetCMS.Content.Ads.Ads();
string Type = Request.QueryString["Type"];
DataTable dt = null;
string str_Url = "";
string adsID = NetCMS.Common.Input.checkID(Request.QueryString["adsID"]); //检测参数
if (Type == "Txt") //文字广告
{
//增加点击数
ac.upClickNum(adsID, "1");
//取得文字广告链接地址
dt = ac.getAdsPicInfo(" AdID,AdLink", "adstxt", adsID);
if (dt != null)
{
if (dt.Rows.Count > 0)
{
str_Url = dt.Rows[0]["AdLink"].ToString();
string str_TempID = dt.Rows[0]["AdID"].ToString();
//添加统计信息
ac.addStat(str_TempID, Request.ServerVariables["REMOTE_ADDR"].ToString());
dt.Clear();dt.Dispose();
//转到广告链接页面
Response.Redirect(str_Url);
}
else
{
PageError("参数错误!", "");
}
dt.Clear();
dt.Dispose();
}
else
{
PageError("参数错误!", "");
}
}
else //图片广告
{
//增加点击数
ac.upClickNum(adsID, "0");
//取得广告链接地址
dt = ac.getAdsPicInfo("LinkURL", "ads", adsID);
if (dt != null)
{
if (dt.Rows.Count > 0)
{
str_Url = dt.Rows[0]["LinkURL"].ToString();
//添加统计信息
ac.addStat(adsID, Request.ServerVariables["REMOTE_ADDR"].ToString());
dt.Clear();dt.Dispose();
//转到广告链接页面
Response.Redirect(str_Url);
}
else
{
PageError("参数错误!", "");
}
dt.Clear();
dt.Dispose();
}
else
{
PageError("参数错误!", "");
}
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -