判断程序集中是否有某个类

//这个函数可判断程序集中是否有某个类
public class ClassManager
{

public bool ExsistClass(string classname)
{
    System.Reflection.Assembly a
= System.Reflection.Assembly.GetEntryAssembly();
Type[] classes 
= a.GetTypes();
foreach( Type c in classes)
{
if(c.ToString().ToLower().EndsWith(classname.ToLower()))
{
   MessageBox.Show(c.ToString());
   
return true;
}

}

return false;
}

}

posted on 2006-04-17 09:24  冷月孤峰  阅读(194)  评论(0)    收藏  举报