Calling an function inside an internal class from an another executable

前端 未结 2 1335
借酒劲吻你
借酒劲吻你 2021-02-15 18:46

I want to call a function from a .net executable from my own code. I used reflector and saw this:

namespace TheExe.Core
{
    internal static class AssemblyInfo
         


        
2条回答
  •  暖寄归人
    2021-02-15 19:29

    You are passing an array of strings as a single parameter with your current code.

    Since string[] can be coerced to object[], you can just pass the parameters array into Invoke.

    string result = (string)mi.Invoke(null, parameters);
    

提交回复
热议问题