📄 anonymousprofile.aspx.cs
字号:
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;
using System.Drawing;
public partial class AnonymousProfile : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
txtAnonymousUser.Text += this.Request.AnonymousID;
//载入匿名用户喜好的颜色
if (Profile.喜好颜色 != Color.Empty)
{
txtAnonymousUser.BackColor = Profile.喜好颜色;
new AlertMessage().showMsg(this.Page,"已载入您喜好的颜色!");
}
}
}
//存储匿名用户Profile
protected void btnSave_Click(object sender, EventArgs e)
{
try
{
Profile.喜好颜色 = Color.FromName(dwnColor.SelectedValue);
if (dwnColor.SelectedValue != "")
{
txtAnonymousUser.BackColor = Color.FromName(dwnColor.SelectedValue);
}
new AlertMessage().showMsg(this.Page, "匿名用户喜好的颜色保存成功");
}
catch(Exception ex)
{
new AlertMessage().showMsg(this.Page,ex.Message.ToString());
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -