this.Load += delegate
            {
                RedirectAPILogin(appInfo);
                this.Load += delegate { };
            };这是今天在看Discuz时看到的一段代码,看不懂,请教各位前辈。
另外有研究过Discuz的高手,也请帮忙指点下!

解决方案 »

  1.   

    没错,就是匿名委托
    this.Load += delegate
                {
                    RedirectAPILogin(appInfo);
                    this.Load += delegate { };
                };类似于:
    void abc(object sender, EventArgs e){
      RedirectAPILogin(appInfo);
    }
    this.Load += abc;不过this.Load += delegate { };
    这句话有啥意义,我也没明白
      

  2.   


    谢谢
    我现在在研究Discuz论坛,就是在一个已有的项目的登录页面后台实现Discuz页面登录,即像Discuz后台一样控制对象状态,以及相应其他更改操作,有做过这方面的前辈么?
      

  3.   


    我又不明白了 this.Load 是什么意思?
    这段代码是在页面后台一方法里写的。没有被事件调用
      

  4.   


    上面那段代码是在这么个方法里的
       protected override void ShowPage()
    {
    ......
    }
    但是我压根没发现后台有哪调用了这个方法谁给分析下?
      

  5.   

    首先,this.Load这个应该明白吧?
    比如:this.Load(abc); 那么abc这个方法就会和Page_Load方法一样,会在加载页面的时候运行而protected override void ShowPage()
    这个方法应该是在基类里调用了
    你没看到这个override了么?这是重写方法了