Mega Code Archive

 
Categories / C# / Reflection
 

Gets a value indicating whether this is an output parameter

using System; using System.Reflection;  class parminfo  {     public static void mymethod (int int1m, out string str2m, ref string str3m)     {        str2m = "asdf";     }     public static int Main(string[] args)     {        Type Mytype = Type.GetType("parminfo");        MethodBase Mymethodbase = Mytype.GetMethod("mymethod");        Console.Write("\nMymethodbase = " + Mymethodbase);        ParameterInfo[] Myarray = Mymethodbase.GetParameters();        foreach (ParameterInfo Myparam in Myarray)        {           Console.Write ("\nFor parameter # "   + Myparam.Position               + ", the IsOut is - " +  Myparam.IsOut );        }        return 0;     }  }