LeadBBS.COM 极速ASP论坛 >> LeadBBS官方论坛 >> 技术与交流 >> dotNet技术 >> [求助]请高手帮忙解释一下这个构造函数的意思
[求助]请高手帮忙解释一下这个构造函数的意思 woodsheep,2004-11-23 14:31:42

高手帮忙解释一下这个构造函数的意思,我怎么都看不懂,真实郁闷~~~~~谢谢!!!

public CCUtility(object parent){
     DBOpen();
     try{
        Session=((System.Web.UI.Page)parent).Session;
        Server=((System.Web.UI.Page)parent).Server;
        Request=((System.Web.UI.Page)parent).Request;
        Response=((System.Web.UI.Page)parent).Response;
        }catch{
          Session=((System.Web.UI.UserControl)parent).Session;
        Server=((System.Web.UI.UserControl)parent).Server;
        Request=((System.Web.UI.UserControl)parent).Request;
        Response=((System.Web.UI.UserControl)parent).Response;
        }
     }[em12]

flyingonnet,2004-11-23 15:27:29

不通, 怎么能在catch 里边做 那些.

这个应该是页面把自己传到后方, 后方把object parent  cast 成page class, 然后去看Session, Server 等等object.
catch 部分就不对了,应该是catch 各种exception.

woodsheep,2004-11-23 16:30:54

这是在一个.cs为后缀的文件里找到的,看到这里就不懂了
jimil,2004-11-23 17:41:38

望着上面的一段,我感到要走的路还很长啊~~~~~~~~~~
xuandhu,2004-11-26 10:08:34

本来程序的路比人生的路还长
 97 1 8: 此主题共有5帖 此页5帖 每页12帖 

[查看完整模式]

Page created in 0.6094 seconds width 3 queries.