I am wondering if it is possible to load a .net DLL at runtime, view the methods available and execute one at runtime.
If this is possible could you point me in the right direction
There are two methods to call a function from string stored in a variable. The first one is by using the window object method and the second one is by using eval() method. The eval() method is older and it is deprecated.
Generally, you use System.Reflection classes to do this task.
Specifically, you'd load the DLL via Assembly.Load (or Assembly.LoadFrom) and then call Assembly.GetTypes and then for each type call Type.GetMethods. When you have a MethodInfo, you can call MethodInfo.Invoke on it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With