List Assembly Info : MethodInfo « Reflection « C# / C Sharp






List Assembly Info

    

using System;
using System.Collections;
using System.Reflection;

public class MainClass{
    public static void Main(){
        Assembly LoadedAsm = Assembly.LoadFrom("System.String");
        Console.WriteLine(LoadedAsm.FullName);
        if (LoadedAsm.GlobalAssemblyCache == true) {
            Console.WriteLine("\tThis is a Global Assembly");
        } else {
            Console.WriteLine("\tThis is a Local Assembly");
        }
        MethodInfo entry = LoadedAsm.EntryPoint;
        if (entry != null) {
            Console.WriteLine("\tAssembly EntryPoint:\t{0}", entry.Name);
        } else {
            Console.WriteLine("\tThis Assembly has no Entry point.");
        }
        object[] attrs = LoadedAsm.GetCustomAttributes(true);
        if (attrs.Length == 0) {
            Console.WriteLine("\tNo Custom Attributes Found");
        } else {
            Console.WriteLine("\tFound Attributes");
            foreach (object o in attrs) {
                Console.WriteLine("\t\t{0}", o.ToString());
            }
        }
    }
}

   
    
    
  








Related examples in the same category

1.MethodInfo: Name
2.Type.GetMethods
3.dump the public methods of a class
4.Finding the class that contains a method in an assembly.
5.Invoke methods using reflectionInvoke methods using reflection
6.Analyze methods using reflectionAnalyze methods using reflection
7.dynamic invocation is demonstrated with MethodInfo.Invoke and Type.InvokeMember
8.Invokes the method.
9.Call a static method in a nested namespace.
10.Gets a MethodBody that provides access to the MSIL stream, local variables, and exceptions for the current method.
11.Gets the parameters of the specified method or constructor.
12.Invokes the method or constructor represented by the current instance, using the specified parameters.
13.Gets a value indicating whether the method is abstract.
14.Indicating whether the potential visibility of this method or constructor is described by MethodAttributes.Assembly
15.Gets a value indicating whether this method is final.
16.Is it a public method.
17.MethodInfo List