C# 程序集获取指定函数名

https://www.cnblogs.com/sf-2020/p/14210443.html

 




public static Type typen(string typeName) { Type type = null; Assembly[] assemblyArray = AppDomain.CurrentDomain.GetAssemblies(); int assemblyArrayLength = assemblyArray.Length; for (int i = 0; i < assemblyArrayLength; ++i) { type = assemblyArray[i].GetType(typeName); if (type != null) { return type; } } for (int i = 0; (i < assemblyArrayLength); ++i) { Type[] typeArray = assemblyArray[i].GetTypes(); int typeArrayLength = typeArray.Length; for (int j = 0; j < typeArrayLength; ++j) { if (typeArray[j].Name.Equals(typeName)) { return typeArray[j]; } } } return type; }

 

posted @ 2022-04-28 10:54  sun_dust_shadow  阅读(183)  评论(0编辑  收藏  举报