Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
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
SHA Tester 2.0
subtração
basics of generics
amstrong number
Strings Mix
OOP vs DOD
Selected Poetry of Rumi doy/poem#
text
test2
1234