I Want to use Reflection to execute my function(Which name is GetAverage,With no parameter) And this function is in class by name of Gold.
I Use This Code :
string MyFunction = "GetAverages";
Type type = typeof(MyGoldClass);
MethodInfo info = type.GetMethod(MyFunction);
int res = (int)info.Invoke(type,null);
res += 3;
But it do not work and Make instance Error Which i do not know what that is. ATTENTION MyFunction Is a Public Function In Gold Class.And i Want Calling and executing This in Other C# Page.