Get Method Names using Reflection

We want to call the Inform static method by using the string "Inform" and we want to call it twice with different parameters. 
  1. using System;  
  2. using System.Reflection;  
  3. static class Methods  
  4. {  
  5. public static void Inform(string parameter)  
  6. {  
  7. Console.WriteLine("Inform:parameter={0}", parameter);  
  8. }  
  9. }  
  10. class Program  
  11. {  
  12. static void Main()  
  13. {  
  14. // Name of the method we want to call.  
  15. string name = "Inform";  
  16. // Call it with each of these parameters.  
  17. string[] parameters = { "Raj""Test" };  
  18. // Get MethodInfo.  
  19. Type type = typeof(Methods);  
  20. MethodInfo info = type.GetMethod(name);  
  21. // Loop over parameters.  
  22. foreach (string parameter in parameters)  
  23. {  
  24. info.Invoke(nullnew object[] { parameter });  
  25. }  
  26. }  
  27. }  
Output
Inform:parameter=Raj
Inform:parameter=Test