zoukankan      html  css  js  c++  java
  • LINQ与反射

    string file = @"C:Windowswinsxsx86_netfx35linq-system.core_31bf3856ad364e35_6.1.7601.17514_none_6161fc35ed136622System.Core.dll";
                Assembly assembly = Assembly.LoadFrom(file);
    
                var pubTypeQuery = from type in assembly.GetTypes()
                                   where type.IsPublic
                                   from method in type.GetMethods()
                                   where method.ReturnType == typeof(string)
                                   group method.ToString() by type.ToString();
    
                foreach (var item in pubTypeQuery)
                {
                    Console.WriteLine(item.Key);
                    foreach (var item1 in item)
                    {
                        Console.WriteLine(item1);                    
                    }                
                }
    
                Console.WriteLine();
                Console.WriteLine("Press Any Key to Exit...");
                Console.ReadKey();
  • 相关阅读:
    每日总结
    每日总结
    每日总结
    每日总结
    每日总结
    每日总结
    每日总结
    每日总结
    Java学习哈希表2
    Java学习哈希表1
  • 原文地址:https://www.cnblogs.com/zhengwk/p/5302582.html
Copyright © 2011-2022 走看看