2nd code example doesn't work
// Using Reflection to get information from an Assembly:
System.Reflection.Assembly integerTypeAssembly = typeof(System.Int32).Assembly;
System.Console.WriteLine(integerTypeAssembly); // mscorlib, Version=126.96.36.199, Culture=neutral, PublicKeyToken=b77a5c561934e089
// We can then Create a new Instance of whatever this type may be, and call it's methods.
object integerInstance = Activator.CreateInstance(integerTypeAssembly);
// Now we can use integerInstance as if it was an Intger Type, calling its MaxCValue function.
You're very much correct, I should of tested the snippet in .Net Fiddle before posting it. I wrote is as pseudo code, but can see how it could be misinterpreted. I've updated the example with one that actually works. Although the Integer class is a very boring example!
We're a place where coders share, stay up-to-date and grow their careers.
We strive for transparency and don't collect excess data.