How could I go about calling a method on a static class given the class name and the method name, please?
For example:
Given System.Environment
What you are doing here is reflecting on the type named Environment and using the GetPropery and GetGetMethod methods to get the get method of the Environment.CurrentDirectory property like so;
var getMethod = typeof(Environment).GetProperty("CurentDirectory", BindingFlags.Public | BindingFlags.Static).GetGetMethod();
var currentDirectory = (string)getMethod.Invoke(null, null);
Calling the get method of a property returns it's value and is equivilent to;
var value = Environment.CurrentDirectory;