private void btnList_Click(object sender, System.EventArgs e)
{
string fileName=labelFile.Text.Trim();
string result="";
txtMethods.Text="";
txtTypes.Text="";
if(File.Exists(fileName))
{
try
{
Assembly assembly=Assembly.LoadFrom(fileName);
Type[] types=assembly.GetTypes();
result="The Assembly contains the following types :"+Environment.NewLine;
for(int i=0;i<types.GetLength(0);++i)
{
result+="\t "+i+":"+types[i].Name+" "+" "+Environment.NewLine;
// Get the public methods.
MethodInfo[] myArrayMethodInfo=types[i].GetMethods(BindingFlags.Public 关键词:C#中运用反射显示程序集的所有分类与属性