欢迎来到飞鸟慕鱼博客,开始您的技术之旅!
当前位置: 首页知识笔记正文

Title: Under what circumstances is IsByRef true?

墨初 知识笔记 70阅读

MSDN's description of Easby Leaf is: gets a value indicating whether the type is passed by reference. Visible,只有当所判断的Type为参数且必须按引用传递的情况下,IsByRef才为true。class program {static void main (string args) {program program=new program (); MethodInfo method information=program. GetType().get method ("some method"); parameter infoparameter=method info。 Get parameter (); Foreach (var parameter in parameter) {Console. WriteLine (parameter. Parameter type. IsByRef); } console. read(); } public void some method (ref object obj) {}} Note is a parameter that must be judged. Parameter type. IsByRef, but not a parameter. GetType().IsByRef。 Parameters. The value of the parameter type is system. The object is the type of the parameter itself, and the parameter. The value of GetType () is parameter information.

标签:
声明:无特别说明,转载请标明本文来源!