本文整理汇总了C#中HtmlLink类的典型用法代码示例。如果您正苦于以下问题:C# HtmlLink类的具体用法?C# HtmlLink怎么用?C# HtmlLink使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
HtmlLink类属于命名空间,在下文中一共展示了HtmlLink类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: OnLoad
protected override void OnLoad(EventArgs e)
{
string customStyleSheet = AppSettings.CustomStyleSheet;
if (!String.IsNullOrEmpty(customStyleSheet))
{
HtmlHead head = FindControl("head") as HtmlHead;
if (head == null && Master != null)
{
head = Master.FindControl("head") as HtmlHead;
}
if (head != null)
{
if (AppRelativeVirtualPath.StartsWith("~/Admin/") && customStyleSheet.ToLower().StartsWith("styles/"))
{
customStyleSheet = "../" + customStyleSheet;
}
HtmlLink customLink = new HtmlLink();
head.Controls.Add(customLink);
customLink.Href = customStyleSheet;
customLink.Attributes["type"] = "text/css";
customLink.Attributes["rel"] = "Stylesheet";
}
}
base.OnLoad(e);
}
开发者ID:ClaireBrill,项目名称:GPV,代码行数:30,代码来源:CustomStyledPage.cs
示例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/EventCommunicate.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);
}
YesButton.SERVER_CLICK += SaveSettingsDB;
if (!IsPostBack)
{
Data dat = new Data(DateTime.Parse(cookie.Value.ToString().Replace("%20", " ").Replace("%3A", ":")));
try
{
if (Session["User"] != null)
{
DoUser();
}
}
catch (Exception ex)
{
}
}
}
开发者ID:aleksczajka,项目名称:Hippo-Code---OLD,代码行数:34,代码来源:EventCommunicate.aspx.cs
示例3: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
Eucalypto.Forum.Category category = Eucalypto.Forum.ForumManager.GetCategoryByName(ForumName, true);
if (Eucalypto.SecurityHelper.CanRead(Page.User, category, null) == false)
throw new Eucalypto.InvalidPermissionException("read forum");
HtmlLink link = new HtmlLink();
link.Href = Navigation.Forum_ForumRss(ForumName).GetServerUrl(true);
link.Attributes.Add("rel", "alternate");
link.Attributes.Add("type", "application/rss+xml");
link.Attributes.Add("title", "Forum " + category.DisplayName + " News");
Header.Controls.Add(link);
linkNewTopic.HRef = Navigation.Forum_NewTopic(ForumName).GetServerUrl(true);
linkRss.HRef = Navigation.Forum_ForumRss(ForumName).GetServerUrl(true);
lblForumName.InnerText = category.DisplayName;
lblDescription.InnerText = category.Description;
linkNewTopic.Visible = Eucalypto.SecurityHelper.CanInsert(Page.User, category);
linkSearch.HRef = Navigation.Forum_Search().GetServerUrl(true);
topicList.CategoryName = ForumName;
}
开发者ID:Learion,项目名称:BruceToolSet,代码行数:25,代码来源:ViewForum.aspx.cs
示例4: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
Eucalypto.Wiki.Category category = Eucalypto.Wiki.WikiManager.GetCategoryByName(CategoryName, true);
if (Eucalypto.SecurityHelper.CanRead(Page.User, category, null) == false)
throw new Eucalypto.InvalidPermissionException("read category");
lblDisplayName.InnerText = category.DisplayName;
lblDescription.InnerText = category.Description;
HtmlLink link = new HtmlLink();
link.Href = Navigation.Wiki_CategoryRss(CategoryName).GetServerUrl(true);
link.Attributes.Add("rel", "alternate");
link.Attributes.Add("type", "application/rss+xml");
link.Attributes.Add("title", "Category " + category.DisplayName + " News");
Header.Controls.Add(link);
linkNew.HRef = Navigation.Wiki_NewArticle(CategoryName).GetServerUrl(true);
linkRss.HRef = Navigation.Wiki_CategoryRss(CategoryName).GetServerUrl(true);
linkNew.Visible = Eucalypto.SecurityHelper.CanInsert(Page.User, category);
linkSearch.HRef = Navigation.Wiki_Search().GetServerUrl(true);
LoadList(category);
}
开发者ID:Learion,项目名称:BruceToolSet,代码行数:27,代码来源:ViewCategory.aspx.cs
示例5: 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/EventUpdate.aspx";
head.Controls.AddAt(0, lk);
HtmlMeta hm = new HtmlMeta();
hm.Name = "ROBOTS";
hm.Content = "NOINDEX, NOFOLLOW";
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);
}
Response.Redirect("~/Home.aspx");
if (Session["User"] == null)
{
Response.Redirect("~/Home.aspx");
}
Data dat = new Data(DateTime.Parse(cookie.Value.ToString().Replace("%20", " ").Replace("%3A", ":")));
DataSet dsEvent = dat.GetData("SELECT * FROM Events WHERE ID="+Request.QueryString["ID"].ToString());
nameLabel.Text = "Enter an update for the event ' " + dsEvent.Tables[0].Rows[0]["Header"].ToString() +" '";
}
开发者ID:aleksczajka,项目名称:Hippo-Code---OLD,代码行数:31,代码来源:EventUpdate.aspx.cs
示例6: Page_Init
protected void Page_Init(object sender, EventArgs e)
{
// reference minified stylesheets
DateTime lastWriteTime = MinifiedStylesheetsHandler.GetLastWriteTime();
HtmlLink link = new HtmlLink();
link.Attributes["type"] = "text/css";
link.Attributes["rel"] ="stylesheet";
link.Href = "Styles/MinifiedStylesheets.ashx" + GetCacheControl(lastWriteTime) + "&ext=.css";
head.Controls.Add(link);
// reference minified scripts if not in debug mode
if (System.Diagnostics.Debugger.IsAttached)
{
string query = AppSettings.AllowDevScriptCaching ? "" : GetCacheControl();
foreach (ScriptItem scriptItem in MinifiedScriptsHandler.GetList())
{
head.Controls.Add(MakeScriptReference(scriptItem.FileName + query));
}
}
else
{
lastWriteTime = MinifiedScriptsHandler.GetLastWriteTime();
head.Controls.Add(MakeScriptReference("Scripts/MinifiedScripts.ashx" + GetCacheControl(lastWriteTime) + "&ext=.js"));
}
_config = AppContext.GetConfiguration();
}
开发者ID:ClaireBrill,项目名称:GPV,代码行数:31,代码来源:Viewer.aspx.cs
示例7: 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/InviteFriendAlert.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);
}
ASP.controls_bluebutton_ascx SendButton = (ASP.controls_bluebutton_ascx)SearchPanel.Items[0].Items[0].FindControl("SendButton");
SendButton.SERVER_CLICK = SendIt;
Label MessageLabel = (Label)SearchPanel.Items[0].Items[0].FindControl("MessageLabel");
MessageLabel.Text = "";
Data dat = new Data(DateTime.Parse(cookie.Value.ToString().Replace("%20", " ").Replace("%3A", ":")));
try
{
if (Session["User"] != null)
{
int count = 0;
if (Infolabel.Text != "")
{
count = int.Parse(Infolabel.Text);
}
else
{
count = 5;
Infolabel.Text = "5";
}
Panel FriendPanel = (Panel)SearchPanel.Items[0].Items[0].FindControl("FriendPanel");
FriendPanel.Controls.Clear();
TextBox text;
for (int i = 1; i <= count; i++)
{
text = new TextBox();
text.ID = "text" + i.ToString();
text.Width = 250;
FriendPanel.Controls.Add(text);
}
}
else
{
Response.Redirect("login");
}
}
catch (Exception ex)
{
}
}
开发者ID:aleksczajka,项目名称:Hippo-Code---OLD,代码行数:59,代码来源:InviteFriendAlert.aspx.cs
示例8: AddStyleSheet
public void AddStyleSheet(Page page, string cssPath)
{
HtmlLink link = new HtmlLink();
link.Href = cssPath;
link.Attributes["rel"] = "stylesheet";
link.Attributes["type"] = "text/css";
page.Header.Controls.Add(link);
}
开发者ID:xiaomincui,项目名称:100allin,代码行数:8,代码来源:NewList.aspx.cs
示例9: AddLinkedStyle
protected void AddLinkedStyle(string url)
{
HtmlLink hLink = new HtmlLink();
hLink.Attributes.Add("type", "text/css");
hLink.Attributes.Add("rel", "stylesheet");
hLink.Attributes.Add("href", url);
Page.Header.Controls.Add(hLink);
}
开发者ID:LiuYingyingCSU,项目名称:JobskyOA,代码行数:8,代码来源:SignInAndOut.aspx.cs
示例10: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
HtmlHead head = (HtmlHead)Page.Header;
HtmlLink lk = new HtmlLink();
lk.Href = "http://" + Request.Url.Authority + "/ProhibitedAds.aspx";
lk.Attributes.Add("rel", "bookmark");
head.Controls.AddAt(0, lk);
}
开发者ID:aleksczajka,项目名称:Hippo-Code---OLD,代码行数:8,代码来源:ProhibitedAds.aspx.cs
示例11: AddStyleSheet
public static void AddStyleSheet(HtmlHead header, string cssPath)
{
HtmlLink lnk = new HtmlLink();
lnk.Href = cssPath;
lnk.Attributes["text"] = "text/css";
lnk.Attributes["rel"] = "stylesheet";
header.Controls.Add(lnk);
}
开发者ID:solo123,项目名称:AGMV,代码行数:9,代码来源:PageTools.cs
示例12: Button3_Click
protected void Button3_Click(object sender, EventArgs e)
{
HtmlLink link = new HtmlLink();
link.Href = "CustomStyles.css";
link.Attributes.Add("rel", "stylesheet");
link.Attributes.Add("type", "text/css");
Header.Controls.Add(link);
}
开发者ID:spbooks,项目名称:ASPNETANT1,代码行数:9,代码来源:Header.aspx.cs
示例13: 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/RateExperience.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];
//FormsAuthenticationTicket authTicket = null;
SubmitButton.SERVER_CLICK = SendIt;
try
{
//string group = "";
//if (authCookie != null)
//{
// authTicket = FormsAuthentication.Decrypt(authCookie.Value);
// group = authTicket.UserData.ToString();
//}
if (Request.QueryString["ID"] != null & Request.QueryString["Type"] != null)
{
//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
{
Response.Redirect("home");
}
}
catch (Exception ex)
{
Response.Redirect("home");
}
if (Request.QueryString["ID"] == null || Request.QueryString["Type"] == null)
{
Response.Redirect("home");
}
}
开发者ID:aleksczajka,项目名称:Hippo-Code---OLD,代码行数:57,代码来源:RateExperience.aspx.cs
示例14: OnInit
protected override void OnInit(EventArgs e)
{
System.Web.UI.Page pg = (System.Web.UI.Page)HttpContext.Current.CurrentHandler;
HtmlLink link = new HtmlLink();
link.Attributes.Add("href", "stylePage.css");
link.Attributes.Add("media", "screen");
link.Attributes.Add("rel", "stylesheet");
link.Attributes.Add("type", "text/css");
pg.Header.Controls.Add(link);
}
开发者ID:GerardoGala,项目名称:CanyonLake,代码行数:10,代码来源:Pictionary.aspx.cs
示例15: setupStyle
protected void setupStyle()
{
HtmlLink style;
style = new HtmlLink();
style.Href = "~/FO_Style/personalistico.css";
style.Attributes.Add("media", "screen");
style.Attributes.Add("type", "text/css");
style.Attributes.Add("rel", "stylesheet");
Header.Controls.Add(style);
}
开发者ID:JCanhoto,项目名称:ToolsQtools,代码行数:10,代码来源:FO_Login.aspx.cs
示例16: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
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", ":")));
HtmlMeta hm = new HtmlMeta();
HtmlHead head = (HtmlHead)Page.Header;
hm.Name = "ROBOTS";
hm.Content = "NOINDEX, FOLLOW";
head.Controls.AddAt(0, hm);
HtmlLink lk = new HtmlLink();
lk.Attributes.Add("rel", "canonical");
lk.Href = "http://hippohappenings.com/HippoPointsEdit.aspx";
head.Controls.AddAt(0, lk);
UploadButton.SERVER_CLICK += UploadPick;
PictureNixItButton.SERVER_CLICK += NixIt;
BlueButton2.SERVER_CLICK += Save;
ErrorLabel.Text = "";
Literal lit = new Literal();
lit.Text = dat.GetDataDV("SELECT * FROM HippoPointsConditions")[0]["Content"].ToString();
TACTextBox.Controls.Add(lit);
if (!IsPostBack)
{
DataView dvUser = dat.GetDataDV("SELECT * FROM UserPreferences UP WHERE UP.UserID=" + Session["User"].ToString());
if(dvUser[0]["MayorText"].ToString().Trim() != "")
DescriptionTextBox.Text = dvUser[0]["MayorText"].ToString();
Checkbox1.Checked = bool.Parse(dvUser[0]["Mayors"].ToString());
if (dvUser[0]["PictureName"].ToString().Trim() != "")
{
TheImage.ImageUrl = dvUser[0]["PictureName"].ToString();
PictureNixItButton.Visible = true;
}
if (dvUser[0]["MayorLink"].ToString().Trim() != "")
{
LinkTextBox.Text = dvUser[0]["MayorLink"].ToString();
}
}
}
开发者ID:aleksczajka,项目名称:Hippo-Code---OLD,代码行数:55,代码来源:HippoPointsEdit.aspx.cs
示例17: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
SignInButton.SERVER_CLICK += MakeItSo;
HtmlLink lk = new HtmlLink();
HtmlHead head = (HtmlHead)Page.Header;
lk.Attributes.Add("rel", "canonical");
lk.Href = "http://hippohappenings.com/ResetPassword.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", ":")));
//Ads1.DATA_SET = dat.RetrieveAllAds(false);
//Ads1.MAIN_AD_DATA_SET = dat.RetrieveAllAds(true);
if (Request.QueryString["CODE"] == null || Request.QueryString["UserName"] == null)
{
Response.Redirect("home");
}
else
{
SqlDbType[] types = { SqlDbType.NVarChar };
object[] parameters = { Request.QueryString["UserName"].ToString() };
DataSet ds = dat.GetDataWithParemeters("SELECT * FROM Users WHERE [email protected]", types, parameters);
bool isNot = false;
if (ds.Tables.Count > 0)
if (ds.Tables[0].Rows.Count > 0)
{
string code = ds.Tables[0].Rows[0]["PasswordReset"].ToString();
if (code != Request.QueryString["CODE"].ToString())
Response.Redirect("home");
else
{
UserLabel.Text = Request.QueryString["UserName"].ToString();
}
}
else
isNot = true;
else
isNot = true;
}
}
开发者ID:aleksczajka,项目名称:Hippo-Code---OLD,代码行数:54,代码来源:ResetPassword.aspx.cs
示例18: 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)
{
}
}
开发者ID:aleksczajka,项目名称:Hippo-Code---OLD,代码行数:53,代码来源:Feedback.aspx.cs
示例19: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
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);
}
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
{
HtmlHead head = (HtmlHead)Page.Header;
HtmlLink lk = new HtmlLink();
lk.Href = "http://" + Request.Url.Authority + "/EnterEvent.aspx";
lk.Attributes.Add("rel", "bookmark");
head.Controls.AddAt(0, lk);
EventTitle.Text = "<a style=\"text-decoration: none; color: white;\" href=\"http://" + Request.Url.Authority + "/EnterEvent.aspx\" >Event Blogging</a>";
string group = "";
if (authCookie != null)
{
authTicket = FormsAuthentication.Decrypt(authCookie.Value);
group = authTicket.UserData.ToString();
}
Session["RedirectTo"] = "EnterEvent.aspx";
if (group.Contains("User"))
{
Session["User"] = authTicket.Name;
WelcomeLabel.Text = "On Hippo Happenings, the users have all the power to post events, ads and venues alike. " +
"Having an account with us also allows you to do many other things. You're able to add events to your calendar, communicate with others going to events, add your friends, filter content based on your preferences, " +
" feature your ads thoughout the site and much more. <br/><br/>So let's go <a class=\"AddLink\" style=\"font-size: 16px;\" href=\"BlogEvent.aspx\">Blog an Event!</a>";
}
else
{
WelcomeLabel.Text = "On Hippo Happenings, the users have all the power to post events, ads and venues alike. In order to do so, and for us to maintain clean and manageable content, "
+ " we require that you <a class=\"AddLink\" href=\"Register.aspx\">create an account</a> with us. <a class=\"AddLink\" href=\"UserLogin.aspx\">Log in</a> if you have an account already. " +
"Having an account with us will allow you to do many other things as well. You'll will be able to add events to your calendar, communicate with others going to events, add your friends, filter content based on your preferences, " +
" feature your ads thoughout the site and much more. <br/><br/>So let's go <a class=\"AddLink\" style=\"font-size: 16px;\" href=\"Register.aspx\">Register!</a>";
}
}
catch (Exception ex)
{
Response.Redirect("~/UserLogin.aspx");
}
}
开发者ID:aleksczajka,项目名称:Hippo-Code---OLD,代码行数:53,代码来源:EnterEvent.aspx.cs
示例20: 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");
}
}
开发者ID:aleksczajka,项目名称:Hippo-Code---OLD,代码行数:52,代码来源:HippoError.aspx.cs
注:本文中的HtmlLink类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论