Run Code
|
API
|
Code Wall
|
Users
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Blog
Invoke method via reflection
//Title of this code //Rextester.Program.Main is the entry point for your code. Don't change it. using System; using System.Collections.Generic; using System.Linq; using System.Text.RegularExpressions; using System.Reflection; namespace Rextester { public class Program { public static void Main(string[] args) { var ob = new SomeClass(); MethodInfo method = ob.GetType().GetMethod("Do"); method.Invoke(ob, new object[] { }); } } public class SomeClass { public void Do() { Console.WriteLine("Do!"); } } }
run
|
edit
|
history
|
help
0
Please
log in
to post a comment.
Simple Parallel.For example
Problem: rstring
Code wall rules
Checking time span between two timezone times
Hello word
Sort example
Program
CommandForce2
Hallo world
1.1 Basics: language constructs
stackse - search stackoverflow differently
Please log in to post a comment.