Specifying out params for Type.GetMethod

前端 未结 2 1674
太阳男子
太阳男子 2021-01-07 18:16

I\'m using reflection to get at the TryParse method info (upvote for the first person to guess why ;).

If I call:

typeof(Int32).GetMethod(\"Parse\",
         


        
2条回答
  •  无人及你
    2021-01-07 18:56

    Try this

    typeof(Int32).GetMethod("TryParse",
      BindingFlags.Static | BindingFlags.Public,
      null,
      new Type[] { typeof(string), typeof(Int32).MakeByRefType() },
      null);
    

提交回复
热议问题