Examples/eUser.aspx.cs

(开头部分) 1KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using EKETEAM.FrameWork;

namespace eFrameWork.Examples
{
    public partial class _eUser : System.Web.UI.Page
    {
        public eUser user;
        private eAction action;
        protected void Page_Load(object sender, EventArgs e)
        {
            user = new eUser("TestArea");
            //user.URL = "Login.aspx";//用户未登录跳转登录地址,默认为Login.aspx
            action = new eAction();
            action.Actioning += action_Actioning;
            action.Listen();

           


        }
        protected void action_Actioning(string Action)
        {
            switch (Action)
            {
                case "":
       
                    if (user.Logined)
                    {
                        litBody.Text = "用户ID:" + user["ID"] + "<br>用户名:" + user["Name"];
                    }
                    else
                    {
                        litBody.Text = "无";
                    }
                    break;
                case "login": //登录                    
                    user["id"] = "111";//添加登录信息:方式一
                    user.Add("name", "eketeam");//添加登录信息:方式二
                    user.Save();

                    Response.Redirect("eUser.aspx", true);
                    break;
                case "loginout": //退出登录
                    user.Remove();//删除登录信息
                    Response.Redirect("eUser.aspx", true);
                    break;
            }
        }
        protected void Page_PreRender(object sender, EventArgs e)
        {
            if (Master == null) return;
            Literal lit = (Literal)Master.FindControl("LitTitle");
            if (lit != null)
            {
                lit.Text = "eUser类-eFrameWork示例中心";
后面还有 4 行代码,解锁后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明

AI 解读

登录后可用,每次 10 积分,解读结果公开显示在下面。

还没有人解读过这个文件。