LINQ与反射

it2026-02-10  18

string file = @"C:\Windows\winsxs\x86_netfx35linq-system.core_31bf3856ad364e35_6.1.7601.17514_none_6161fc35ed136622\System.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();

 

转载于:https://www.cnblogs.com/zhengwk/p/5302582.html

相关资源:在linq查询中使用反射
最新回复(0)