本文整理汇总了C#中Data.RetrieveAds方法的典型用法代码示例。如果您正苦于以下问题:C# Data.RetrieveAds方法的具体用法?C# Data.RetrieveAds怎么用?C# Data.RetrieveAds使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Data
的用法示例。
在下文中一共展示了Data.RetrieveAds方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
HttpCookie cookie = Request.Cookies["BrowserDate"];
string cookieName = FormsAuthentication.FormsCookieName;
HttpCookie authCookie = Context.Request.Cookies[cookieName];
Data dat = new Data(DateTime.Parse(cookie.Value.ToString().Replace("%20", " ").Replace("%3A", ":")));
FormsAuthenticationTicket authTicket = null;
try
{
string group = "";
if (authCookie != null)
{
authTicket = FormsAuthentication.Decrypt(authCookie.Value);
group = authTicket.UserData.ToString();
}
if (group.Contains("User"))
{
Session["User"] = authTicket.Name;
DataSet ds1 = dat.GetData("SELECT UserName FROM Users WHERE User_ID=" + authTicket.Name);
Session["UserName"] = ds1.Tables[0].Rows[0]["UserName"].ToString();
DataSet ds2 = dat.RetrieveAds(Session["User"].ToString(), false);
}
else
{
}
}
catch (Exception ex)
{
Response.Redirect("~/UserLogin.aspx");
}
}
示例2: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
HtmlLink lk = new HtmlLink();
HtmlHead head = (HtmlHead)Page.Header;
lk.Attributes.Add("rel", "canonical");
lk.Href = "http://hippohappenings.com/HippoError.aspx";
head.Controls.AddAt(0, lk);
HtmlMeta hm = new HtmlMeta();
hm.Name = "ROBOTS";
hm.Content = "NOINDEX, FOLLOW";
head.Controls.AddAt(0, hm);
HttpCookie cookie = Request.Cookies["BrowserDate"];
if (cookie == null)
{
cookie = new HttpCookie("BrowserDate");
cookie.Value = DateTime.Now.ToString();
cookie.Expires = DateTime.Now.AddDays(22);
Response.Cookies.Add(cookie);
}
Data dat = new Data(DateTime.Parse(cookie.Value.ToString().Replace("%20", " ").Replace("%3A", ":")));
string cookieName = FormsAuthentication.FormsCookieName;
HttpCookie authCookie = Context.Request.Cookies[cookieName];
FormsAuthenticationTicket authTicket = null;
try
{
string group = "";
if (authCookie != null)
{
authTicket = FormsAuthentication.Decrypt(authCookie.Value);
group = authTicket.UserData.ToString();
}
if (group.Contains("User"))
{
Session["User"] = authTicket.Name;
DataSet ds1 = dat.GetData("SELECT UserName FROM Users WHERE User_ID=" + authTicket.Name);
Session["UserName"] = ds1.Tables[0].Rows[0]["UserName"].ToString();
DataSet ds2 = dat.RetrieveAds(Session["User"].ToString(), false);
}
else
{
}
}
catch (Exception ex)
{
Response.Redirect("~/login");
}
}
示例3: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
HtmlLink lk = new HtmlLink();
HtmlHead head = (HtmlHead)Page.Header;
lk.Attributes.Add("rel", "canonical");
lk.Href = "http://hippohappenings.com/Feedback.aspx";
head.Controls.AddAt(0, lk);
HttpCookie cookie = Request.Cookies["BrowserDate"];
if (cookie == null)
{
cookie = new HttpCookie("BrowserDate");
cookie.Value = DateTime.Now.ToString();
cookie.Expires = DateTime.Now.AddDays(22);
Response.Cookies.Add(cookie);
}
Data dat = new Data(DateTime.Parse(cookie.Value.ToString().Replace("%20", " ").Replace("%3A", ":")));
string cookieName = FormsAuthentication.FormsCookieName;
HttpCookie authCookie = Context.Request.Cookies[cookieName];
//Button button = (Button)dat.FindControlRecursive(this, "Button1");
//button.CssClass = "NavBarImageFeedbackSelected";
FormsAuthenticationTicket authTicket = null;
try
{
Session["RedirectTo"] = Request.Url.AbsoluteUri;
string group = "";
if (authCookie != null)
{
authTicket = FormsAuthentication.Decrypt(authCookie.Value);
group = authTicket.UserData.ToString();
}
if (group.Contains("User"))
{
Session["User"] = authTicket.Name;
DataSet ds1 = dat.GetData("SELECT UserName FROM Users WHERE User_ID=" + authTicket.Name);
Session["UserName"] = ds1.Tables[0].Rows[0]["UserName"].ToString();
LoggedInPanel.Visible = true;
LogInPanel.Visible = false;
DataSet ds2 = dat.RetrieveAds(Session["User"].ToString(), false);
}
else
{
LoggedInPanel.Visible = false;
LogInPanel.Visible = true;
}
}
catch (Exception ex)
{
}
}