zoukankan      html  css  js  c++  java
  • 反射

    static void  CheckBasePage()
            {
                Assembly assembly = Assembly.GetAssembly(typeof(BasePage));    
              
                Module module = assembly.ManifestModule;
                Type[] types = module.GetTypes();          
                foreach (Type t in types)
                {
                    try
                    {
                        if (t.IsSubclassOf(typeof(System.Web.UI.Page)))
                        {
                            if (!t.IsSubclassOf(typeof(BasePage)))
                            {
                                string aa = t.ToString() + "没有继承该类";
                                Console.WriteLine(aa);                           
                            }
                        }
                    }
                    catch (Exception ex)
                    {
                        Console.WriteLine(ex.Message + "-" + ex.StackTrace);
                    }

                }

                //Assembly a = Assembly.LoadFile(@" ");
                //Type[] type = a.GetTypes();
                //foreach (Type t in type)
                //{
                  
                //    try
                //    {
                      
                //        if (t.IsSubclassOf(typeof(System.Web.UI.Page)))
                //        {
                //            BasePage o = (BasePage)a.CreateInstance(t.FullName);
                //            object value = t.GetProperty("Guid").GetValue(o, null);
                //        }
                //    }
                //    catch
                //    { }
                //}
            }

  • 相关阅读:
    (OK) angular2-data-table is a Angular2 component for presenting large and complex data.
    Table pagination and Search bar in Angular2
    Angular 2 Tutorial: Create a CRUD App with Angular CLI and TypeScript
    Angular 2 CRUD application using Nodejs
    kernel 3.10内核源码分析--BUG_ON流程
    Protecting Routes using Guards in Angular 2
    Angular 2 User Registration and Login Example & Tutorial
    dmidecode
    (half OK) 在VirtualBox中运行 cm-13-kiwi (华为 荣耀 5X)
    Linux基金会宣布成立OpenSDS组织,应对存储云化转型
  • 原文地址:https://www.cnblogs.com/zwei1121/p/1004638.html
Copyright © 2011-2022 走看看